SceneTryInfo.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using UnityEngine;
  3. public class SceneTryInfo : MonoBehaviour
  4. {
  5. private void Start()
  6. {
  7. GameMain.Instance.SysShortcut.gameObject.SetActive(false);
  8. GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
  9. GameMain.Instance.MainCamera.FadeIn(3f, false, new CameraMain.dgOnCompleteFade(this.OnCompleteFadeIn), true, true, default(Color));
  10. this.m_eMode = SceneTryInfo.Mode.FadeIn;
  11. }
  12. private void Update()
  13. {
  14. if (this.m_eMode == SceneTryInfo.Mode.ClickWait && !GameMain.Instance.CharacterMgr.IsBusy() && this.GetAnyMouseAndKey())
  15. {
  16. GameMain.Instance.SoundMgr.PlaySystem(SoundMgr.SeType.IClick);
  17. GameMain.Instance.MainCamera.FadeOut(1.5f, false, new CameraMain.dgOnCompleteFade(this.OnCompleteFadeOut), true, default(Color));
  18. this.m_eMode = SceneTryInfo.Mode.FadeOut;
  19. }
  20. }
  21. private void OnCompleteFadeIn()
  22. {
  23. this.m_eMode = SceneTryInfo.Mode.ClickWait;
  24. }
  25. private void OnCompleteFadeOut()
  26. {
  27. GameMain.Instance.LoadScene("SceneToTitle");
  28. }
  29. private bool GetAnyMouseAndKey()
  30. {
  31. return NInput.GetMouseButtonUp(0) || NInput.GetMouseButtonUp(1) || NInput.GetMouseButtonUp(2) || Input.GetKeyUp(KeyCode.Return) || GameMain.Instance.IsForceSkip();
  32. }
  33. private SceneTryInfo.Mode m_eMode;
  34. private enum Mode
  35. {
  36. FadeIn,
  37. ClickWait,
  38. FadeOut
  39. }
  40. }