12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- using System;
- using UnityEngine;
- public class SceneWarning : MonoBehaviour
- {
- private void Awake()
- {
- GameObject gameObject = GameObject.Find("UI Root/Warning");
- GameObject gameObject2 = GameObject.Find("UI Root/Warning_tr");
- GameObject gameObject3 = GameObject.Find("UI Root/Warning_cbl_tr");
- gameObject.gameObject.SetActive(false);
- gameObject2.gameObject.SetActive(false);
- gameObject3.gameObject.SetActive(false);
- gameObject.gameObject.SetActive(true);
- }
- 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;
- private enum Mode
- {
- FadeIn,
- ClickWait,
- Loading,
- FadeOut
- }
- }
|