SceneCharacterSelect.cs 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. using System;
  2. using System.Collections.Generic;
  3. using Schedule;
  4. using UnityEngine;
  5. public class SceneCharacterSelect : WfScreenManager
  6. {
  7. public static void CreateYotogiCharaList()
  8. {
  9. SceneCharacterSelect.chara_guid_stock_list.Clear();
  10. List<Maid> yotogiMaids = ScheduleAPI.GetYotogiMaids(GameMain.Instance.CharacterMgr.status.isDaytime);
  11. for (int i = 0; i < yotogiMaids.Count; i++)
  12. {
  13. SceneCharacterSelect.chara_guid_stock_list.Add(yotogiMaids[i].status.guid);
  14. }
  15. }
  16. public static void CreateNewYotogiCharaList()
  17. {
  18. SceneCharacterSelect.chara_guid_stock_list.Clear();
  19. List<Maid> newYotogiMaids = ScheduleAPI.GetNewYotogiMaids(GameMain.Instance.CharacterMgr.status.isDaytime);
  20. for (int i = 0; i < newYotogiMaids.Count; i++)
  21. {
  22. SceneCharacterSelect.chara_guid_stock_list.Add(newYotogiMaids[i].status.guid);
  23. }
  24. }
  25. public static void CreateNewYotogiHaremPairCharaList()
  26. {
  27. SceneCharacterSelect.chara_guid_stock_list.Clear();
  28. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  29. if (maid == null)
  30. {
  31. return;
  32. }
  33. for (int i = 0; i < 40; i++)
  34. {
  35. if (!(maid != GameMain.Instance.CharacterMgr.status.GetScheduleSlot(i)))
  36. {
  37. int num = (!GameMain.Instance.CharacterMgr.status.isDaytime) ? maid.status.nightWorkId : maid.status.noonWorkId;
  38. if (!ScheduleCSVData.AllData.ContainsKey(num))
  39. {
  40. Debug.LogError("ScheduleAPI:タスクID[" + num + "]のデータが見つかりませんでした");
  41. }
  42. ScheduleCSVData.ScheduleBase scheduleBase = ScheduleCSVData.AllData[num];
  43. if (scheduleBase.type == ScheduleTaskCtrl.TaskType.Yotogi)
  44. {
  45. ScheduleCSVData.Yotogi yotogi = (ScheduleCSVData.Yotogi)scheduleBase;
  46. if (yotogi.yotogiType == ScheduleCSVData.YotogiType.NewSex && yotogi.pairCondPersonal.Count > 0)
  47. {
  48. foreach (Maid maid2 in ScheduleAPI.GetNewYotogiHaremPairCandidateList(yotogi.pairCondPersonal, maid))
  49. {
  50. SceneCharacterSelect.chara_guid_stock_list.Add(maid2.status.guid);
  51. }
  52. }
  53. }
  54. break;
  55. }
  56. }
  57. }
  58. public static void CreateVipCharaList()
  59. {
  60. SceneCharacterSelect.chara_guid_stock_list.Clear();
  61. List<Maid> vipWorkMaids = ScheduleAPI.GetVipWorkMaids(GameMain.Instance.CharacterMgr.status.isDaytime);
  62. for (int i = 0; i < vipWorkMaids.Count; i++)
  63. {
  64. SceneCharacterSelect.chara_guid_stock_list.Add(vipWorkMaids[i].status.guid);
  65. }
  66. }
  67. public static void CreateFacilityCharaList()
  68. {
  69. SceneCharacterSelect.chara_guid_stock_list.Clear();
  70. List<Maid> facilityPowerUpMaids = ScheduleAPI.GetFacilityPowerUpMaids(GameMain.Instance.CharacterMgr.status.isDaytime);
  71. for (int i = 0; i < facilityPowerUpMaids.Count; i++)
  72. {
  73. SceneCharacterSelect.chara_guid_stock_list.Add(facilityPowerUpMaids[i].status.guid);
  74. }
  75. }
  76. public static bool IsSelectChara()
  77. {
  78. return 0 < SceneCharacterSelect.chara_guid_stock_list.Count;
  79. }
  80. public void Awake()
  81. {
  82. this.adv_kag_ = GameMain.Instance.ScriptMgr.adv_kag;
  83. }
  84. public override void Start()
  85. {
  86. base.Start();
  87. this.move_screen_ = base.children_dic["Move"].GetComponent<WfScreenMoveChildren>();
  88. this.select_type_ = SceneCharacterSelect.SelectType.Communication;
  89. this.select_dance_chara_num_ = 1;
  90. string empty = string.Empty;
  91. string empty2 = string.Empty;
  92. if (this.adv_kag_.tag_backup != null && 0 < this.adv_kag_.tag_backup.Count && this.adv_kag_.tag_backup["name"] == "SceneCharacterSelect")
  93. {
  94. NDebug.Assert(this.adv_kag_.tag_backup.ContainsKey("label"), "SceneCharacterSelectにlabelの設定がされていませんでした");
  95. NDebug.Assert(this.adv_kag_.tag_backup.ContainsKey("type"), "SceneCharacterSelectにtypeの設定がされていませんでした");
  96. this.move_screen_.SetNextLabel(this.adv_kag_.tag_backup["label"]);
  97. if (this.adv_kag_.tag_backup.ContainsKey("cancel_label"))
  98. {
  99. CharacterSelectMain component = base.children_dic["Main"].GetComponent<CharacterSelectMain>();
  100. component.SetCancelLabel(this.adv_kag_.tag_backup["cancel_label"]);
  101. }
  102. try
  103. {
  104. this.select_type_ = (SceneCharacterSelect.SelectType)Enum.Parse(typeof(SceneCharacterSelect.SelectType), this.adv_kag_.tag_backup["type"]);
  105. }
  106. catch
  107. {
  108. NDebug.Assert("SelectType enum parse error.\n" + this.adv_kag_.tag_backup["type"], false);
  109. }
  110. if (this.adv_kag_.tag_backup["type"] == "コミュ")
  111. {
  112. this.select_type_ = SceneCharacterSelect.SelectType.Communication;
  113. }
  114. if (this.adv_kag_.tag_backup.ContainsKey("select_chara_num"))
  115. {
  116. this.select_dance_chara_num_ = int.Parse(this.adv_kag_.tag_backup["select_chara_num"]);
  117. }
  118. if (this.adv_kag_.tag_backup.ContainsKey("maid"))
  119. {
  120. this.select_maid_slot_ = int.Parse(this.adv_kag_.tag_backup["maid"]);
  121. }
  122. }
  123. if (this.select_type_ != SceneCharacterSelect.SelectType.VRComSelect && this.select_type_ != SceneCharacterSelect.SelectType.Additional)
  124. {
  125. GameMain.Instance.MainLight.Reset();
  126. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  127. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  128. }
  129. GameMain.Instance.SoundMgr.VoiceStopAll();
  130. this.CallScreen("Main");
  131. }
  132. protected override void SettingChildrenList(Dictionary<string, WfScreenChildren> children_dic)
  133. {
  134. string[] array = new string[]
  135. {
  136. "Main",
  137. "Move"
  138. };
  139. for (int i = 0; i < array.Length; i++)
  140. {
  141. WfScreenChildren component = UTY.GetChildObject(base.gameObject, array[i], false).GetComponent<WfScreenChildren>();
  142. component.parent_mgr = this;
  143. children_dic.Add(array[i], component);
  144. }
  145. }
  146. public WfScreenMoveChildren move_screen
  147. {
  148. get
  149. {
  150. return this.move_screen_;
  151. }
  152. }
  153. public SceneCharacterSelect.SelectType select_type
  154. {
  155. get
  156. {
  157. return this.select_type_;
  158. }
  159. }
  160. public int select_dance_chara_num
  161. {
  162. get
  163. {
  164. return this.select_dance_chara_num_;
  165. }
  166. }
  167. public int select_maid_slot
  168. {
  169. get
  170. {
  171. return this.select_maid_slot_;
  172. }
  173. }
  174. public static List<string> chara_guid_stock_list = new List<string>();
  175. public static List<Maid> select_maid_list = new List<Maid>();
  176. private WfScreenMoveChildren move_screen_;
  177. private ADVKagManager adv_kag_;
  178. private SceneCharacterSelect.SelectType select_type_;
  179. private int select_dance_chara_num_;
  180. private int select_maid_slot_;
  181. public enum SelectType
  182. {
  183. Communication,
  184. Yotogi,
  185. Vip,
  186. CompetitiveShow,
  187. TouchCharaSelect,
  188. VRComSelect,
  189. Free,
  190. Facility,
  191. Recollection,
  192. VRKaraokeSelect,
  193. Additional,
  194. NewYotogi,
  195. NewYotogiAdditional
  196. }
  197. }