using System; using I2.Loc; using UnityEngine; using wf; public class FluctuationOfParameterUnit : MonoBehaviour { private void Awake() { this.bg_sprite_ = UTY.GetChildObject(base.gameObject, "BGGray", false).GetComponent(); this.name_label_ = UTY.GetChildObject(base.gameObject, "Name", false).GetComponent(); this.value_label_ = UTY.GetChildObject(base.gameObject, "Value", false).GetComponent(); this.name_label_loc_ = this.name_label_.GetComponent(); } public void SetActive(bool value) { base.gameObject.SetActive(value); } public bool IsActive() { return base.gameObject.activeSelf; } public void SetBGVisible(bool value) { this.bg_sprite_.enabled = value; } public bool IsBGVisible() { return this.bg_sprite_.enabled; } public void SetTextName(string name) { this.name_label_.text = name; } public void SetTextNameTerm(string term) { Utility.SetLocalizeTerm(this.name_label_loc_, term, false); } public void SetTextValue(int value) { this.value_label_.text = "0"; if (this.AnimeTime <= 0f) { string str = string.Empty; if (0 < value) { str += "+"; } this.value_label_.text = str + value.ToString(); } else { this.anime_event_ = delegate() { iTween.ValueTo(this.gameObject, iTween.Hash(new object[] { "from", 0, "to", value, "time", this.AnimeTime, "onupdate", "UpdateValue" })); }; } } public void StartAnime() { if (this.anime_event_ != null) { this.anime_event_(); this.anime_event_ = null; } } public void UpdateValue(int value) { string str = string.Empty; if (0 < value) { str += "+"; } this.value_label_.text = str + value.ToString(); } public float AnimeTime = 1f; private UISprite bg_sprite_; private UILabel name_label_; private UILabel value_label_; private Action anime_event_; private Localize name_label_loc_; }