123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using System;
- using UnityEngine;
- public class SceneWarning : MonoBehaviour
- {
- private void Awake()
- {
- foreach (SceneWarning.WarningSet warningSet in this.wirningSet)
- {
- warningSet.displayObject.SetActive(warningSet.type == Product.type);
- }
- }
- private void Start()
- {
- GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
- GameMain.Instance.MainCamera.FadeOutNoUI(0f, true);
- GameMain.Instance.MainCamera.FadeIn(1f, false, new CameraMain.dgOnCompleteFade(this.OnCompleteFadeIn), true, true, default(Color));
- this.m_eMode = SceneWarning.Mode.FadeIn;
- GameMain.Instance.SysShortcut.gameObject.SetActive(false);
- }
- private void Update()
- {
- if (this.m_eMode == SceneWarning.Mode.ClickWait)
- {
- if (this.GetAnyMouseAndKey())
- {
- GameMain.Instance.SoundMgr.PlaySystem(SoundMgr.SeType.IClick);
- GameMain.Instance.LoadIcon.SetForceDraw(true);
- GameMain.Instance.CharacterMgr.LoadDefault();
- this.m_eMode = SceneWarning.Mode.Loading;
- }
- }
- else if (this.m_eMode == SceneWarning.Mode.Loading && !GameMain.Instance.CharacterMgr.IsBusy())
- {
- GameMain.Instance.LoadIcon.SetForceDraw(false);
- GameMain.Instance.CharacterMgr.VisibleAll(false);
- GameMain.Instance.MainCamera.FadeOut(1f, false, new CameraMain.dgOnCompleteFade(this.OnCompleteFadeOut), true, default(Color));
- GameMain.Instance.MainCamera.FadeInNoUI(0f, true);
- this.m_eMode = SceneWarning.Mode.FadeOut;
- }
- }
- private void OnCompleteFadeIn()
- {
- this.m_eMode = SceneWarning.Mode.ClickWait;
- }
- private void OnCompleteFadeOut()
- {
- GameMain.Instance.ScriptMgr.LoadAdvScenarioScript("AllMain.ks", string.Empty);
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- }
- private bool GetAnyMouseAndKey()
- {
- return NInput.GetMouseButtonUp(0) || NInput.GetMouseButtonUp(1) || NInput.GetMouseButtonUp(2) || Input.GetKeyUp(KeyCode.Return) || GameMain.Instance.IsForceSkip();
- }
- private SceneWarning.Mode m_eMode;
- [SerializeField]
- private SceneWarning.WarningSet[] wirningSet;
- [Serializable]
- private struct WarningSet
- {
- public Product.Type type;
- public GameObject displayObject;
- }
- private enum Mode
- {
- FadeIn,
- ClickWait,
- Loading,
- FadeOut
- }
- }
|