FreeModeInit.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. using System;
  2. using MaidStatus;
  3. using UnityEngine;
  4. public class FreeModeInit : WfScreenChildren
  5. {
  6. public override void Awake()
  7. {
  8. base.Awake();
  9. base.SetFadeTime(0f);
  10. }
  11. protected override void OnCall()
  12. {
  13. this.mgr_ = (base.parent_mgr as SceneFreeModeSelectManager);
  14. NDebug.AssertNull(this.mgr_ != null);
  15. GameMain.Instance.ScriptMgr.ClearForcExecWaitEvent();
  16. GameMain.Instance.MsgWnd.CloseMessageWindowPanel();
  17. GameMain.Instance.MsgWnd.CancelSkipAndAuto();
  18. GameMain.Instance.BgMgr.DelPrefabFromBgAll();
  19. if (DailyMgr.IsLegacy)
  20. {
  21. GameMain.Instance.BgMgr.ChangeBg("Salon");
  22. }
  23. else
  24. {
  25. GameMain.Instance.BgMgr.ChangeBg("Theater");
  26. }
  27. GameMain.Instance.MainLight.Reset();
  28. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  29. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  30. GameMain.Instance.SoundMgr.StopSe();
  31. GameMain.Instance.SoundMgr.VoiceStopAll();
  32. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  33. Maid man = characterMgr.GetMan(0);
  34. man.Visible = true;
  35. Maid maid = characterMgr.GetMaid(0);
  36. maid.Visible = true;
  37. string[] array = new string[]
  38. {
  39. "handitem",
  40. "kousoku_upper",
  41. "kousoku_lower",
  42. "skirt",
  43. "panz",
  44. "mizugi",
  45. "onepiece",
  46. "accanl",
  47. "accvag",
  48. "KubiScl",
  49. "UdeScl",
  50. "DouPer",
  51. "sintyou",
  52. "kata"
  53. };
  54. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  55. {
  56. Maid stockMaid = characterMgr.GetStockMaid(i);
  57. if (!(stockMaid == null))
  58. {
  59. stockMaid.ResetAll();
  60. }
  61. }
  62. for (int j = 0; j < characterMgr.GetStockManCount(); j++)
  63. {
  64. Maid stockMan = characterMgr.GetStockMan(j);
  65. if (!(stockMan == null))
  66. {
  67. stockMan.ResetAll();
  68. }
  69. }
  70. for (int k = 1; k < characterMgr.GetMaidCount(); k++)
  71. {
  72. characterMgr.DeactivateMaid(k);
  73. }
  74. if (maid != null)
  75. {
  76. string bgmFileName = maid.status.personal.bgmFileName;
  77. if (!string.IsNullOrEmpty(bgmFileName))
  78. {
  79. if (maid.status.heroineType == HeroineType.Transfer)
  80. {
  81. GameMain.Instance.SoundMgr.PlayBGMLegacy(bgmFileName, 0.5f, true);
  82. }
  83. else
  84. {
  85. GameMain.Instance.SoundMgr.PlayBGM(bgmFileName, 0.5f, true);
  86. }
  87. }
  88. maid.Visible = false;
  89. maid.Visible = true;
  90. maid.FaceAnime("通常", 0f, 0);
  91. maid.FaceAnime("通常", 0.01f, 0);
  92. maid.FaceBlend("無し");
  93. maid.AllProcPropSeqStart();
  94. }
  95. man.AllProcPropSeqStart();
  96. GameMain.Instance.SysShortcut.strSceneHelpName = "SceneFreeModeSelect";
  97. uGUITutorialPanel.OpenTutorial("SceneFreeModeSelect", null, false);
  98. }
  99. protected override bool IsCallFadeIn()
  100. {
  101. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  102. bool flag = !characterMgr.IsBusy();
  103. if (!flag)
  104. {
  105. return false;
  106. }
  107. if (DailyMgr.IsLegacy)
  108. {
  109. YotogiOld.CreateData();
  110. if (!YotogiOldSkillSelectWaitMotion.ApplyMaidGesture(characterMgr.GetMaid(0), YotogiOld.Stage.サロン))
  111. {
  112. return false;
  113. }
  114. }
  115. else if (!YotogiSkillSelectWaitMotion.ApplyMaidGesture(characterMgr.GetMaid(0), YotogiStage.GetAllDatas(true)[0]))
  116. {
  117. return false;
  118. }
  119. GameMain.Instance.MainCamera.SetTargetOffset(new Vector3((float)Screen.width / 256f * 208f - (float)Screen.width / 2f, 0f, 0f), false);
  120. for (int i = 0; i < characterMgr.GetManCount(); i++)
  121. {
  122. Maid man = characterMgr.GetMan(i);
  123. if (man != null && man.Visible)
  124. {
  125. man.Visible = false;
  126. }
  127. }
  128. return flag;
  129. }
  130. protected override void FadeIn()
  131. {
  132. base.FadeIn();
  133. if (base.fade_status == WfScreenChildren.FadeStatus.Wait)
  134. {
  135. this.Finish();
  136. }
  137. }
  138. public override void Update()
  139. {
  140. base.Update();
  141. if (base.fade_status == WfScreenChildren.FadeStatus.Wait)
  142. {
  143. this.Finish();
  144. }
  145. }
  146. protected override void OnFinish()
  147. {
  148. base.OnFinish();
  149. this.mgr_.CallScreen(this.next_screen);
  150. }
  151. public string next_screen { get; set; }
  152. private SceneFreeModeSelectManager mgr_;
  153. }