| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class StatsLine : MonoBehaviour
- {
- public Text statName;
- public Text statValue;
- public void SetStatName(string value) {
- statName.text = value;
- }
- public void SetStatValue(string value) {
- statValue.text = value;
- }
- public void SetStatValue(int value) {
- statValue.text = value.ToString();
- }
- public string GetName() {
- return statName.text;
- }
- public string GetValue() {
- return statValue.text;
- }
- public int GetIntValue() {
- Int32.TryParse(statValue.text, out int returnValue);
- return returnValue;
- }
-
- public void MakeBold() {
- statName.fontStyle = FontStyle.Bold;
- statValue.fontStyle = FontStyle.Bold;
- }
- public void UnBold() {
- statName.fontStyle = FontStyle.Normal;
- statValue.fontStyle = FontStyle.Normal;
- }
- public void SetLocalizationKey(string key) {
- statName.GetComponent<TextLocalization>().key = key;
- }
- public void RemoveLocalization() {
- TextLocalization tl = statName.GetComponent<TextLocalization>();
- Destroy(tl);
- }
- }
|