123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- using System;
- using UnityEngine;
- public class OnaholeReactionManager : MonoBehaviour
- {
- public Maid maid { get; private set; }
- public bool highlightHeart
- {
- get
- {
- return this.highlightHeart_;
- }
- set
- {
- this.highlightHeart_ = value;
- if (this.highlightHeart_ && this.highlightHide_)
- {
- this.highlightHide_ = false;
- }
- this.UpdateHighligParts();
- }
- }
- public bool highlightHide
- {
- get
- {
- return this.highlightHide_;
- }
- set
- {
- this.highlightHide_ = value;
- if (this.highlightHide_ && this.highlightHeart_)
- {
- this.highlightHeart_ = false;
- }
- this.UpdateHighligParts();
- }
- }
- public bool runnyNoseEffect
- {
- get
- {
- return this.runnyNoseEffect_;
- }
- set
- {
- if (this.isReady)
- {
- this.CallReactionFile("*鼻水", value);
- }
- this.runnyNoseEffect_ = value;
- }
- }
- public bool saladEffect
- {
- get
- {
- return this.saladEffect_;
- }
- set
- {
- if (this.isReady)
- {
- this.CallReactionFile("*涎", value);
- }
- this.saladEffect_ = value;
- }
- }
- public bool sweatEffect
- {
- get
- {
- return this.sweatEffect_;
- }
- set
- {
- if (this.isReady)
- {
- this.CallReactionFile("*汗", value);
- }
- this.sweatEffect_ = value;
- }
- }
- public bool breatheEffect
- {
- get
- {
- return this.breatheEffect_;
- }
- set
- {
- if (this.breatheObject != null)
- {
- this.breatheObject.SetActive(value);
- }
- this.breatheEffect_ = value;
- }
- }
- private void Awake()
- {
- this.maid = base.GetComponent<Maid>();
- this.ReadyCheck();
- }
- private void OnDestroy()
- {
- if (!this.isReady)
- {
- return;
- }
- if (this.breatheObject != null)
- {
- this.maid.DelPrefab("夜伽_吐息");
- }
- if (this.maid == null || this.maid.body0 == null || !this.maid.body0.isLoadedBody)
- {
- return;
- }
- bool visible = this.maid.Visible;
- if (this.runnyNoseEffect)
- {
- this.runnyNoseEffect = false;
- }
- if (this.saladEffect)
- {
- this.saladEffect = false;
- }
- if (this.sweatEffect)
- {
- this.sweatEffect = false;
- }
- if (this.breatheEffect)
- {
- this.breatheEffect = false;
- }
- if (this.highlightHeart)
- {
- this.highlightHeart = false;
- }
- if (this.highlightHide)
- {
- this.highlightHide = false;
- }
- if (this.maid.Visible != visible)
- {
- this.maid.Visible = visible;
- }
- }
- private void Start()
- {
- if (this.maid == null)
- {
- this.maid = base.GetComponent<Maid>();
- }
- this.ReadyCheck();
- }
- public void SetMaid(Maid maid)
- {
- if (this.maid == null || maid != null)
- {
- this.maid = maid;
- this.ReadyCheck();
- }
- else if (this.maid != null)
- {
- Debug.LogWarning("OnaholeReactionManager::SetMaid Error:すでにメイドはセットされています");
- }
- }
- public void ResetReaction()
- {
- this.highlightHeart = false;
- this.highlightHide = false;
- this.runnyNoseEffect = false;
- this.saladEffect = false;
- this.sweatEffect = false;
- this.breatheEffect = false;
- }
- private void Update()
- {
- if (!this.isReady)
- {
- this.ReadyCheck();
- }
- }
- private void ReadyCheck()
- {
- if (this.isReady || this.maid == null || this.maid.body0 == null || !this.maid.body0.isLoadedBody || this.maid.IsAllProcPropBusy)
- {
- return;
- }
- this.isReady = true;
- if (this.breatheObject == null)
- {
- this.maid.AddPrefab("Particle/pToiki", "夜伽_吐息", "Bip01 Head", new Vector3(0.042f, 0.076f, 0f), new Vector3(-90f, 90f, 0f));
- this.breatheObject = this.maid.GetPrefab("夜伽_吐息");
- this.breatheEffect = this.breatheEffect_;
- }
- this.sweatEffect = this.sweatEffect_;
- this.UpdateHighligParts();
- }
- private void CallReactionFile(string label, bool enabled)
- {
- if (!this.isReady)
- {
- return;
- }
- if (this.maid.ActiveSlotNo < 0)
- {
- Debug.LogWarning("リアクションファイルを呼び出そうとしましたが、メイドがActiveではありません");
- return;
- }
- GameMain.Instance.ScriptMgr.EvalScript("tf['痕メイド'] = " + this.maid.ActiveSlotNo.ToString());
- GameMain.Instance.ScriptMgr.EvalScript("tf['痕遅延'] = 0");
- if (!enabled)
- {
- label += "_削除";
- }
- GameMain.Instance.ScriptMgr.LoadTempScript("CBLReactionFile.ks", label);
- GameMain.Instance.ScriptMgr.tmp_kag.Exec();
- }
- private void UpdateHighligParts()
- {
- if (!this.isReady)
- {
- return;
- }
- string text = string.Empty;
- if (this.highlightHeart)
- {
- text = "_i_skinhi_nky003.menu";
- }
- if (this.highlightHide_)
- {
- text = "_i_skinhi002.menu";
- }
- if (string.IsNullOrEmpty(text))
- {
- this.maid.ResetProp(MPN.eye_hi, true);
- }
- else
- {
- this.maid.SetProp(MPN.eye_hi, text, 0, true, false);
- }
- this.maid.AllProcProp();
- }
- private const string kHighlightNoneMenuFile = "_i_skinhi002.menu";
- private const string kHighlightHeartMenuFile = "_i_skinhi_nky003.menu";
- private bool isReady;
- private bool runnyNoseEffect_;
- private bool saladEffect_;
- private bool sweatEffect_;
- private bool breatheEffect_;
- private bool highlightHide_;
- private bool highlightHeart_;
- private GameObject breatheObject;
- }
|