123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- 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<UILabel>();
- 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<UILabel>();
- 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<UISprite>().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<UISprite>().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<PrivateMaidTouchParamBasicBar.Kind, PrivateMaidTouchParamBasicBar.BarSet> bar_dic_ = new Dictionary<PrivateMaidTouchParamBasicBar.Kind, PrivateMaidTouchParamBasicBar.BarSet>();
- private Dictionary<PrivateMaidTouchParamBasicBar.GageColor, Color> color_dic_ = new Dictionary<PrivateMaidTouchParamBasicBar.GageColor, Color>();
- 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;
- }
- }
|