ResultWorkAPI.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. using System;
  2. using System.Collections;
  3. using UnityEngine;
  4. public class ResultWorkAPI
  5. {
  6. public void SceneStart(bool f_bIsDay, MonoBehaviour f_parent, ResultWorkAPI.dgOnSceneStartCallBack f_dgLoadedFinish)
  7. {
  8. this.m_bDay = f_bIsDay;
  9. this.m_dgStart = f_dgLoadedFinish;
  10. GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
  11. GameMain.Instance.ScriptMgr.adv_kag.MessageWindowMgr.CloseMessageWindowPanel();
  12. GameMain.Instance.MainLight.Reset();
  13. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  14. GameMain.Instance.MainCamera.Blur(true);
  15. GameMain.Instance.MainCamera.SetTargetOffset(Vector3.zero, false);
  16. if (DailyMgr.IsLegacy)
  17. {
  18. GameMain.Instance.SoundMgr.PlayBGMLegacy("BGM015.ogg", 1f, true);
  19. }
  20. else
  21. {
  22. GameMain.Instance.SoundMgr.PlayBGM("BGM015.ogg", 1f, true);
  23. }
  24. GameMain.Instance.MainCamera.SetTargetPos(new Vector3(0.08306749f, 1.299064f, 0.0249091f), true);
  25. GameMain.Instance.MainCamera.SetDistance(2.2f, true);
  26. GameMain.Instance.MainCamera.SetAroundAngle(new Vector2(177.9044f, 2.546583f), true);
  27. if (f_bIsDay)
  28. {
  29. GameMain.Instance.BgMgr.ChangeBg("ShinShitsumu_ChairRot");
  30. }
  31. else
  32. {
  33. GameMain.Instance.BgMgr.ChangeBg("ShinShitsumu_ChairRot_Night");
  34. }
  35. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  36. f_parent.StartCoroutine(this.CoCharaLoad());
  37. }
  38. private IEnumerator CoCharaLoad()
  39. {
  40. while (GameMain.Instance.CharacterMgr.IsBusy())
  41. {
  42. yield return null;
  43. }
  44. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  45. GameMain.Instance.MainCamera.FadeIn(1f, false, null, true, true, default(Color));
  46. if (this.m_dgStart != null)
  47. {
  48. this.m_dgStart();
  49. }
  50. yield break;
  51. }
  52. public void EndNextScene(ResultWorkAPI.dgOnSceneFinalCallBack f_dgEnd)
  53. {
  54. this.m_dgFinal = f_dgEnd;
  55. if (GameMain.Instance.CharacterMgr.status.GetFlag("時間帯") != 3)
  56. {
  57. GameMain.Instance.SoundMgr.StopBGM(1f);
  58. }
  59. GameMain.Instance.MainCamera.FadeOut(1f, false, new CameraMain.dgOnCompleteFade(this.OnFinishFadeOut), true, default(Color));
  60. }
  61. private void OnFinishFadeOut()
  62. {
  63. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  64. if (this.m_dgFinal != null)
  65. {
  66. this.m_dgFinal();
  67. }
  68. }
  69. public void SceneFinish()
  70. {
  71. if (GameMain.Instance.MainCamera != null)
  72. {
  73. GameMain.Instance.MainCamera.SetTargetOffset(Vector3.zero, false);
  74. }
  75. if (GameMain.Instance.CharacterMgr != null)
  76. {
  77. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  78. }
  79. }
  80. private ResultWorkAPI.dgOnSceneStartCallBack m_dgStart;
  81. private ResultWorkAPI.dgOnSceneFinalCallBack m_dgFinal;
  82. private bool m_bDay = true;
  83. public delegate void dgOnSceneStartCallBack();
  84. public delegate void dgOnSceneFinalCallBack();
  85. }