StaffRollAPI.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using System;
  2. using System.Collections;
  3. using UnityEngine;
  4. public class StaffRollAPI
  5. {
  6. public void SceneStart(MonoBehaviour f_parent, StaffRollAPI.dgOnSceneStartCallBack f_dgLoadedFinish)
  7. {
  8. this.m_dgStart = f_dgLoadedFinish;
  9. GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
  10. GameMain.Instance.ScriptMgr.adv_kag.MessageWindowMgr.CloseMessageWindowPanel();
  11. GameMain.Instance.MainLight.Reset();
  12. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  13. GameMain.Instance.MainCamera.Vignett(false);
  14. GameMain.Instance.MainCamera.SetControl(true);
  15. GameMain.Instance.MainCamera.SetTargetPos(new Vector3(0.5609447f, 1.380762f, -1.382336f), true);
  16. GameMain.Instance.MainCamera.SetDistance(1.6f, true);
  17. GameMain.Instance.MainCamera.SetAroundAngle(new Vector2(245.5691f, 6.273283f), true);
  18. GameMain.Instance.MainCamera.SetTargetOffset(Vector3.zero, false);
  19. GameMain.Instance.MainLight.SetIntensity(0.65f);
  20. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  21. f_parent.StartCoroutine(this.CoCharaLoad());
  22. }
  23. private IEnumerator CoCharaLoad()
  24. {
  25. while (GameMain.Instance.CharacterMgr.IsBusy())
  26. {
  27. yield return null;
  28. }
  29. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  30. GameMain.Instance.MainCamera.FadeIn(1f, false, null, true, true, default(Color));
  31. if (this.m_dgStart != null)
  32. {
  33. this.m_dgStart();
  34. }
  35. yield break;
  36. }
  37. public void EndNextScene(StaffRollAPI.dgOnSceneFinalCallBack f_dgEnd)
  38. {
  39. this.m_dgFinal = f_dgEnd;
  40. GameMain.Instance.SoundMgr.StopBGM(1f);
  41. GameMain.Instance.MainCamera.FadeOut(1f, false, new CameraMain.dgOnCompleteFade(this.OnFinishFadeOut), true, default(Color));
  42. }
  43. private void OnFinishFadeOut()
  44. {
  45. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  46. GameMain.Instance.MainCamera.SetControl(true);
  47. if (this.m_dgFinal != null)
  48. {
  49. this.m_dgFinal();
  50. }
  51. }
  52. public void SceneFinish()
  53. {
  54. if (GameMain.Instance.MainCamera != null)
  55. {
  56. GameMain.Instance.MainCamera.SetTargetOffset(Vector3.zero, false);
  57. }
  58. if (GameMain.Instance.CharacterMgr != null)
  59. {
  60. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  61. }
  62. }
  63. private StaffRollAPI.dgOnSceneStartCallBack m_dgStart;
  64. private StaffRollAPI.dgOnSceneFinalCallBack m_dgFinal;
  65. public delegate void dgOnSceneStartCallBack();
  66. public delegate void dgOnSceneFinalCallBack();
  67. }