123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using wf;
- public class YotogiParamBasicBar : MonoBehaviour
- {
- public virtual void Awake()
- {
- if (0 < this.bar_dic_.Count)
- {
- return;
- }
- YotogiParamBasicBar.BarSet barSet = new YotogiParamBasicBar.BarSet();
- barSet.min = -100;
- 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(YotogiParamBasicBar.Kind.Excite, barSet);
- YotogiParamBasicBar.BarSet barSet2 = new YotogiParamBasicBar.BarSet();
- barSet2.min = 0;
- barSet2.max = 100;
- barSet2.gauge_trans = UTY.GetChildObject(base.gameObject, "Mind/GaugeGroup/Gauge", false).transform;
- barSet2.num_label = UTY.GetChildObject(base.gameObject, "Mind/Value", false).GetComponent<UILabel>();
- this.bar_dic_.Add(YotogiParamBasicBar.Kind.Mind, barSet2);
- YotogiParamBasicBar.BarSet barSet3 = new YotogiParamBasicBar.BarSet();
- barSet3.min = 0;
- barSet3.max = 300;
- barSet3.gauge_trans = UTY.GetChildObject(base.gameObject, "Reason/GaugeGroup/Gauge", false).transform;
- barSet3.num_label = UTY.GetChildObject(base.gameObject, "Reason/Value", false).GetComponent<UILabel>();
- this.bar_dic_.Add(YotogiParamBasicBar.Kind.Sensual, barSet3);
- this.color_dic_.Add(YotogiParamBasicBar.GageColor.Blue, new Color(0f, 0.5f, 1f));
- this.color_dic_.Add(YotogiParamBasicBar.GageColor.Red, new Color(1f, 0f, 0f));
- this.color_dic_.Add(YotogiParamBasicBar.GageColor.Yellow, new Color(1f, 1f, 0f));
- this.color_dic_.Add(YotogiParamBasicBar.GageColor.Orange, new Color(1f, 0.5f, 0f));
- this.color_dic_.Add(YotogiParamBasicBar.GageColor.Pink, new Color(1f, 0f, 0.5f));
- }
- public void SetMaid(Maid maid)
- {
- this.maid_ = maid;
- if (YotogiManager.instans != null && YotogiManager.instans.is_new_yotogi_mode)
- {
- UILabel component = UTY.GetChildObject(base.gameObject, "Mind/Name", false).GetComponent<UILabel>();
- if (component != null)
- {
- Utility.SetLocalizeTerm(component, "MaidStatus/時間", false);
- }
- }
- }
- public void SetMaxMind(int max_num)
- {
- this.bar_dic_[YotogiParamBasicBar.Kind.Mind].max = max_num;
- }
- public virtual void SetCurrentExcite(int cur_num, bool is_anime)
- {
- YotogiParamBasicBar.BarSet barSet = this.bar_dic_[YotogiParamBasicBar.Kind.Excite];
- barSet.num_label.text = cur_num.ToString();
- float num = (float)(cur_num + barSet.min * -1) / (float)barSet.max;
- num -= 0.333333343f;
- Color color;
- if (200 <= cur_num)
- {
- color = this.color_dic_[YotogiParamBasicBar.GageColor.Red];
- }
- else if (100 <= cur_num)
- {
- color = this.color_dic_[YotogiParamBasicBar.GageColor.Orange];
- }
- else if (0 <= cur_num)
- {
- color = this.color_dic_[YotogiParamBasicBar.GageColor.Yellow];
- }
- else
- {
- color = this.color_dic_[YotogiParamBasicBar.GageColor.Blue];
- }
- 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;
- }
- }
- public void SetCurrentMind(int cur_num, bool is_anime)
- {
- YotogiParamBasicBar.BarSet barSet = this.bar_dic_[YotogiParamBasicBar.Kind.Mind];
- 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_[YotogiParamBasicBar.GageColor.Red];
- }
- else
- {
- color = this.color_dic_[YotogiParamBasicBar.GageColor.Blue];
- }
- 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;
- }
- }
- public void SetCurrentSensual(int cur_num, bool is_anime)
- {
- YotogiParamBasicBar.BarSet barSet = this.bar_dic_[YotogiParamBasicBar.Kind.Sensual];
- barSet.num_label.text = cur_num.ToString();
- float x = (float)cur_num / (float)barSet.max;
- Color color = this.color_dic_[YotogiParamBasicBar.GageColor.Pink];
- 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;
- }
- }
- private bool is_new_yotogi_mode
- {
- get
- {
- return YotogiManager.instans != null && YotogiManager.instans.is_new_yotogi_mode;
- }
- }
- private Dictionary<YotogiParamBasicBar.Kind, YotogiParamBasicBar.BarSet> bar_dic_ = new Dictionary<YotogiParamBasicBar.Kind, YotogiParamBasicBar.BarSet>();
- private Dictionary<YotogiParamBasicBar.GageColor, Color> color_dic_ = new Dictionary<YotogiParamBasicBar.GageColor, Color>();
- protected Maid maid_;
- private enum Kind
- {
- Excite,
- Mind,
- Sensual
- }
- 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;
- }
- }
|