123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- 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<UISprite>();
- this.name_label_ = UTY.GetChildObject(base.gameObject, "Name", false).GetComponent<UILabel>();
- this.value_label_ = UTY.GetChildObject(base.gameObject, "Value", false).GetComponent<UILabel>();
- this.name_label_loc_ = this.name_label_.GetComponent<Localize>();
- }
- 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_;
- }
|