FreeModeInit.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. using System;
  2. using System.IO;
  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.isCompatiblePersonality)
  80. {
  81. GameMain.Instance.SoundMgr.PlayBGMLegacy(bgmFileName, 0.5f, true);
  82. }
  83. else
  84. {
  85. string text = (!maid.status.personal.oldPersonal) ? string.Empty : (Path.GetFileNameWithoutExtension(bgmFileName) + "_OLD.ogg");
  86. if (!string.IsNullOrEmpty(text) && GameUty.FileSystem.IsExistentFile(text))
  87. {
  88. GameMain.Instance.SoundMgr.PlayBGM(text, 0.5f, true);
  89. }
  90. else
  91. {
  92. GameMain.Instance.SoundMgr.PlayBGM(bgmFileName, 0.5f, true);
  93. }
  94. }
  95. }
  96. maid.Visible = false;
  97. maid.Visible = true;
  98. maid.FaceAnime("通常", 0f, 0);
  99. maid.FaceAnime("通常", 0.01f, 0);
  100. maid.FaceBlend("無し");
  101. maid.AllProcPropSeqStart();
  102. }
  103. man.AllProcPropSeqStart();
  104. GameMain.Instance.SysShortcut.strSceneHelpName = "SceneFreeModeSelect";
  105. uGUITutorialPanel.OpenTutorial("SceneFreeModeSelect", null, false);
  106. }
  107. protected override bool IsCallFadeIn()
  108. {
  109. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  110. bool flag = !characterMgr.IsBusy();
  111. if (!flag)
  112. {
  113. return false;
  114. }
  115. if (DailyMgr.IsLegacy)
  116. {
  117. YotogiOld.CreateData();
  118. if (!YotogiOldSkillSelectWaitMotion.ApplyMaidGesture(characterMgr.GetMaid(0), YotogiOld.Stage.サロン))
  119. {
  120. return false;
  121. }
  122. }
  123. else if (!YotogiSkillSelectWaitMotion.ApplyMaidGesture(characterMgr.GetMaid(0), YotogiStage.GetAllDatas(true)[0]))
  124. {
  125. return false;
  126. }
  127. GameMain.Instance.MainCamera.SetTargetOffset(new Vector3((float)Screen.width / 256f * 208f - (float)Screen.width / 2f, 0f, 0f), false);
  128. for (int i = 0; i < characterMgr.GetManCount(); i++)
  129. {
  130. Maid man = characterMgr.GetMan(i);
  131. if (man != null && man.Visible)
  132. {
  133. man.Visible = false;
  134. }
  135. }
  136. return flag;
  137. }
  138. protected override void FadeIn()
  139. {
  140. base.FadeIn();
  141. if (base.fade_status == WfScreenChildren.FadeStatus.Wait)
  142. {
  143. this.Finish();
  144. }
  145. }
  146. public override void Update()
  147. {
  148. base.Update();
  149. if (base.fade_status == WfScreenChildren.FadeStatus.Wait)
  150. {
  151. this.Finish();
  152. }
  153. }
  154. protected override void OnFinish()
  155. {
  156. base.OnFinish();
  157. this.mgr_.CallScreen(this.next_screen);
  158. }
  159. public string next_screen { get; set; }
  160. private SceneFreeModeSelectManager mgr_;
  161. }