SceneWarning.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using System;
  2. using UnityEngine;
  3. public class SceneWarning : MonoBehaviour
  4. {
  5. private void Awake()
  6. {
  7. string name = "Warning_eng_try";
  8. GameObject gameObject = GameObject.Find("UI Root");
  9. gameObject.transform.Find(name).gameObject.SetActive(true);
  10. }
  11. private void Start()
  12. {
  13. GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
  14. GameMain.Instance.MainCamera.FadeOutNoUI(0f, true);
  15. GameMain.Instance.MainCamera.FadeIn(1f, false, new CameraMain.dgOnCompleteFade(this.OnCompleteFadeIn), true, true, default(Color));
  16. this.m_eMode = SceneWarning.Mode.FadeIn;
  17. GameMain.Instance.SysShortcut.gameObject.SetActive(false);
  18. }
  19. private void Update()
  20. {
  21. if (this.m_eMode == SceneWarning.Mode.ClickWait)
  22. {
  23. if (this.GetAnyMouseAndKey())
  24. {
  25. GameMain.Instance.SoundMgr.PlaySystem(SoundMgr.SeType.IClick);
  26. GameMain.Instance.LoadIcon.SetForceDraw(true);
  27. GameMain.Instance.CharacterMgr.LoadDefault();
  28. this.m_eMode = SceneWarning.Mode.Loading;
  29. }
  30. }
  31. else if (this.m_eMode == SceneWarning.Mode.Loading && !GameMain.Instance.CharacterMgr.IsBusy())
  32. {
  33. GameMain.Instance.LoadIcon.SetForceDraw(false);
  34. GameMain.Instance.CharacterMgr.VisibleAll(false);
  35. GameMain.Instance.MainCamera.FadeOut(1f, false, new CameraMain.dgOnCompleteFade(this.OnCompleteFadeOut), true, default(Color));
  36. GameMain.Instance.MainCamera.FadeInNoUI(0f, true);
  37. this.m_eMode = SceneWarning.Mode.FadeOut;
  38. }
  39. }
  40. private void OnCompleteFadeIn()
  41. {
  42. this.m_eMode = SceneWarning.Mode.ClickWait;
  43. }
  44. private void OnCompleteFadeOut()
  45. {
  46. GameMain.Instance.ScriptMgr.LoadAdvScenarioScript("AllMain.ks", string.Empty);
  47. GameMain.Instance.ScriptMgr.adv_kag.Exec();
  48. }
  49. private bool GetAnyMouseAndKey()
  50. {
  51. return NInput.GetMouseButtonUp(0) || NInput.GetMouseButtonUp(1) || NInput.GetMouseButtonUp(2) || Input.GetKeyUp(KeyCode.Return) || GameMain.Instance.IsForceSkip();
  52. }
  53. private SceneWarning.Mode m_eMode;
  54. private enum Mode
  55. {
  56. FadeIn,
  57. ClickWait,
  58. Loading,
  59. FadeOut
  60. }
  61. }