using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using wf; public class PrivateMaidTouchParamBasicBar : MonoBehaviour { public virtual void Awake() { if (0 < this.bar_dic_.Count) { return; } PrivateMaidTouchParamBasicBar.BarSet barSet = new PrivateMaidTouchParamBasicBar.BarSet(); barSet.min = 0; barSet.max = 300; barSet.gauge_trans = UTY.GetChildObject(base.gameObject, "Excited/GaugeGroup/Gauge", false).transform; barSet.num_label = UTY.GetChildObject(base.gameObject, "Excited/Value", false).GetComponent(); this.bar_dic_.Add(PrivateMaidTouchParamBasicBar.Kind.Excite, barSet); PrivateMaidTouchParamBasicBar.BarSet barSet2 = new PrivateMaidTouchParamBasicBar.BarSet(); barSet2.min = 0; barSet2.max = 300; barSet2.gauge_trans = UTY.GetChildObject(base.gameObject, "Mood/GaugeGroup/Gauge", false).transform; barSet2.num_label = UTY.GetChildObject(base.gameObject, "Mood/Value", false).GetComponent(); this.bar_dic_.Add(PrivateMaidTouchParamBasicBar.Kind.Mood, barSet2); this.color_dic_.Add(PrivateMaidTouchParamBasicBar.GageColor.Blue, new Color(0f, 0.5f, 1f)); this.color_dic_.Add(PrivateMaidTouchParamBasicBar.GageColor.Red, new Color(1f, 0f, 0f)); this.color_dic_.Add(PrivateMaidTouchParamBasicBar.GageColor.Yellow, new Color(1f, 1f, 0f)); this.color_dic_.Add(PrivateMaidTouchParamBasicBar.GageColor.Orange, new Color(1f, 0.5f, 0f)); this.color_dic_.Add(PrivateMaidTouchParamBasicBar.GageColor.Pink, new Color(1f, 0f, 0.5f)); } public void SetMaid(Maid maid) { this.maid_ = maid; } public virtual void SetCurrentMood(int cur_num, bool is_anime) { PrivateMaidTouchParamBasicBar.BarSet barSet = this.bar_dic_[PrivateMaidTouchParamBasicBar.Kind.Mood]; barSet.num_label.text = cur_num.ToString(); float x = (float)cur_num / (float)barSet.max; Color color; if (200 <= cur_num) { color = this.color_dic_[PrivateMaidTouchParamBasicBar.GageColor.Red]; } else if (100 <= cur_num) { color = this.color_dic_[PrivateMaidTouchParamBasicBar.GageColor.Orange]; } else if (50 <= cur_num) { color = this.color_dic_[PrivateMaidTouchParamBasicBar.GageColor.Yellow]; } else { color = this.color_dic_[PrivateMaidTouchParamBasicBar.GageColor.Blue]; } barSet.gauge_trans.GetComponent().color = color; Vector3 vector = new Vector3(x, 1f, 1f); if (is_anime) { Hashtable args = TweenHash.EaseOutSine(TweenHash.Type.Scale, vector, 0.4f); iTween.ScaleTo(barSet.gauge_trans.gameObject, args); } else { barSet.gauge_trans.localScale = vector; } } public void SetCurrentExcite(int cur_num, bool is_anime) { PrivateMaidTouchParamBasicBar.BarSet barSet = this.bar_dic_[PrivateMaidTouchParamBasicBar.Kind.Excite]; barSet.num_label.text = cur_num.ToString(); float num = (float)cur_num / (float)barSet.max; Color color; if ((double)num <= 0.3) { color = this.color_dic_[PrivateMaidTouchParamBasicBar.GageColor.Blue]; } else { color = this.color_dic_[PrivateMaidTouchParamBasicBar.GageColor.Red]; } barSet.gauge_trans.GetComponent().color = color; Vector3 vector = new Vector3(num, 1f, 1f); if (is_anime) { Hashtable args = TweenHash.EaseOutSine(TweenHash.Type.Scale, vector, 0.4f); iTween.ScaleTo(barSet.gauge_trans.gameObject, args); } else { barSet.gauge_trans.localScale = vector; } } private Dictionary bar_dic_ = new Dictionary(); private Dictionary color_dic_ = new Dictionary(); protected Maid maid_; private enum Kind { Excite, Mood } private enum GageColor { Blue, Red, Yellow, Orange, Pink } private class BarSet { public Transform gauge_trans; public UILabel num_label; public int min; public int max; } }