CompetitiveShowAPI.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. using System;
  2. using System.Collections;
  3. using UnityEngine;
  4. public class CompetitiveShowAPI
  5. {
  6. public void SceneStart(MonoBehaviour f_parent, Maid visible_maid, CompetitiveShowAPI.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.MainLight.SetRotation(new Vector3(28.99218f, 178.2424f, 16.81662f));
  13. GameMain.Instance.MainLight.SetIntensity(0.95f);
  14. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  15. GameMain.Instance.MainCamera.SetTargetPos(new Vector3(0.08306749f, 1.299064f, 0.0249091f), true);
  16. GameMain.Instance.MainCamera.SetDistance(2.2f, true);
  17. GameMain.Instance.MainCamera.SetAroundAngle(new Vector2(177.9044f, 2.546583f), true);
  18. GameMain.Instance.MainCamera.SetTargetOffset(Vector3.zero, false);
  19. GameMain.Instance.SoundMgr.VoiceStopAll();
  20. if (CompetitiveShowMgr.compatibilityMode)
  21. {
  22. GameMain.Instance.BgMgr.ChangeBg("Salon");
  23. }
  24. else
  25. {
  26. GameMain.Instance.BgMgr.ChangeBg("Theater");
  27. }
  28. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  29. if (visible_maid == null)
  30. {
  31. visible_maid = GameMain.Instance.CharacterMgr.GetStockMaid(0);
  32. }
  33. GameMain.Instance.CharacterMgr.SetActiveMaid(visible_maid, 0);
  34. visible_maid.Visible = true;
  35. f_parent.StartCoroutine(this.CoCharaLoad());
  36. }
  37. private IEnumerator CoCharaLoad()
  38. {
  39. while (GameMain.Instance.CharacterMgr.IsBusy())
  40. {
  41. yield return null;
  42. }
  43. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  44. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  45. ScriptManager script_mgr = GameMain.Instance.ScriptMgr;
  46. script_mgr.is_motion_blend = false;
  47. script_mgr.LoadMotionScript(0, false, "h_kaiwa_tati_001.ks", "*会話立ち待機", string.Empty, string.Empty, false, true, false, false);
  48. script_mgr.is_motion_blend = true;
  49. maid.FaceAnime("通常", 1f, 0);
  50. maid.FaceBlend("無し");
  51. maid.EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
  52. GameMain.Instance.MainCamera.FadeIn(1f, false, null, true, true, default(Color));
  53. if (this.m_dgStart != null)
  54. {
  55. this.m_dgStart();
  56. }
  57. yield break;
  58. }
  59. public void EndNextScene(CompetitiveShowAPI.dgOnSceneFinalCallBack f_dgEnd)
  60. {
  61. this.m_dgFinal = f_dgEnd;
  62. GameMain.Instance.MainCamera.FadeOut(1f, false, new CameraMain.dgOnCompleteFade(this.OnFinishFadeOut), true, default(Color));
  63. }
  64. private void OnFinishFadeOut()
  65. {
  66. if (this.m_dgFinal != null)
  67. {
  68. this.m_dgFinal();
  69. }
  70. }
  71. public void SceneFinish()
  72. {
  73. if (GameMain.Instance.MainCamera != null)
  74. {
  75. GameMain.Instance.MainCamera.SetTargetOffset(Vector3.zero, false);
  76. }
  77. if (GameMain.Instance.CharacterMgr != null)
  78. {
  79. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  80. }
  81. }
  82. private CompetitiveShowAPI.dgOnSceneStartCallBack m_dgStart;
  83. private CompetitiveShowAPI.dgOnSceneFinalCallBack m_dgFinal;
  84. public delegate void dgOnSceneStartCallBack();
  85. public delegate void dgOnSceneFinalCallBack();
  86. }