SceneCharacterSelect.cs 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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, 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 void CreateLifeModeCharaList()
  77. {
  78. SceneCharacterSelect.chara_guid_stock_list.Clear();
  79. List<Maid> list = new List<Maid>();
  80. CharacterSelectManager.DefaultMaidList(list);
  81. foreach (Maid maid in EmpireLifeModeAPI.SelectionMaidList(list))
  82. {
  83. SceneCharacterSelect.chara_guid_stock_list.Add(maid.status.guid);
  84. }
  85. }
  86. public static void StoreCharaGuidStockList()
  87. {
  88. SceneCharacterSelect.backup_chara_guid_stock_list = new List<string>(SceneCharacterSelect.chara_guid_stock_list);
  89. }
  90. public static void ReStoreCharaGuidStockList()
  91. {
  92. SceneCharacterSelect.chara_guid_stock_list.Clear();
  93. foreach (string item in SceneCharacterSelect.backup_chara_guid_stock_list)
  94. {
  95. SceneCharacterSelect.chara_guid_stock_list.Add(item);
  96. }
  97. }
  98. public static bool IsSelectChara()
  99. {
  100. return 0 < SceneCharacterSelect.chara_guid_stock_list.Count;
  101. }
  102. public void Awake()
  103. {
  104. this.adv_kag_ = GameMain.Instance.ScriptMgr.adv_kag;
  105. }
  106. public override void Start()
  107. {
  108. base.Start();
  109. this.move_screen_ = base.children_dic["Move"].GetComponent<WfScreenMoveChildren>();
  110. this.select_type_ = SceneCharacterSelect.SelectType.Communication;
  111. this.select_dance_chara_num_ = 1;
  112. string empty = string.Empty;
  113. string empty2 = string.Empty;
  114. if (this.adv_kag_.tag_backup != null && 0 < this.adv_kag_.tag_backup.Count && this.adv_kag_.tag_backup["name"] == "SceneCharacterSelect")
  115. {
  116. NDebug.Assert(this.adv_kag_.tag_backup.ContainsKey("label"), "SceneCharacterSelectにlabelの設定がされていませんでした");
  117. NDebug.Assert(this.adv_kag_.tag_backup.ContainsKey("type"), "SceneCharacterSelectにtypeの設定がされていませんでした");
  118. this.move_screen_.SetNextLabel(this.adv_kag_.tag_backup["label"]);
  119. if (this.adv_kag_.tag_backup.ContainsKey("cancel_label"))
  120. {
  121. CharacterSelectMain component = base.children_dic["Main"].GetComponent<CharacterSelectMain>();
  122. component.SetCancelLabel(this.adv_kag_.tag_backup["cancel_label"]);
  123. }
  124. try
  125. {
  126. this.select_type_ = (SceneCharacterSelect.SelectType)Enum.Parse(typeof(SceneCharacterSelect.SelectType), this.adv_kag_.tag_backup["type"]);
  127. }
  128. catch
  129. {
  130. NDebug.Assert("SelectType enum parse error.\n" + this.adv_kag_.tag_backup["type"], false);
  131. }
  132. if (this.adv_kag_.tag_backup["type"] == "コミュ")
  133. {
  134. this.select_type_ = SceneCharacterSelect.SelectType.Communication;
  135. }
  136. if (this.adv_kag_.tag_backup.ContainsKey("select_chara_num"))
  137. {
  138. this.select_dance_chara_num_ = int.Parse(this.adv_kag_.tag_backup["select_chara_num"]);
  139. }
  140. if (this.adv_kag_.tag_backup.ContainsKey("maid"))
  141. {
  142. this.select_maid_slot_ = int.Parse(this.adv_kag_.tag_backup["maid"]);
  143. }
  144. }
  145. if (this.select_type_ != SceneCharacterSelect.SelectType.VRComSelect && this.select_type_ != SceneCharacterSelect.SelectType.Additional)
  146. {
  147. GameMain.Instance.MainLight.Reset();
  148. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  149. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  150. }
  151. GameMain.Instance.SoundMgr.VoiceStopAll();
  152. this.CallScreen("Main");
  153. }
  154. protected override void SettingChildrenList(Dictionary<string, WfScreenChildren> children_dic)
  155. {
  156. string[] array = new string[]
  157. {
  158. "Main",
  159. "Move"
  160. };
  161. for (int i = 0; i < array.Length; i++)
  162. {
  163. WfScreenChildren component = UTY.GetChildObject(base.gameObject, array[i], false).GetComponent<WfScreenChildren>();
  164. component.parent_mgr = this;
  165. children_dic.Add(array[i], component);
  166. }
  167. }
  168. public WfScreenMoveChildren move_screen
  169. {
  170. get
  171. {
  172. return this.move_screen_;
  173. }
  174. }
  175. public SceneCharacterSelect.SelectType select_type
  176. {
  177. get
  178. {
  179. return this.select_type_;
  180. }
  181. }
  182. public int select_dance_chara_num
  183. {
  184. get
  185. {
  186. return this.select_dance_chara_num_;
  187. }
  188. }
  189. public int select_maid_slot
  190. {
  191. get
  192. {
  193. return this.select_maid_slot_;
  194. }
  195. }
  196. public static List<string> chara_guid_stock_list = new List<string>();
  197. public static List<string> backup_chara_guid_stock_list = new List<string>();
  198. public static List<Maid> select_maid_list = new List<Maid>();
  199. private WfScreenMoveChildren move_screen_;
  200. private ADVKagManager adv_kag_;
  201. private SceneCharacterSelect.SelectType select_type_;
  202. private int select_dance_chara_num_;
  203. private int select_maid_slot_;
  204. public enum SelectType
  205. {
  206. Communication,
  207. Yotogi,
  208. Vip,
  209. CompetitiveShow,
  210. TouchCharaSelect,
  211. VRComSelect,
  212. Free,
  213. Facility,
  214. Recollection,
  215. VRKaraokeSelect,
  216. Additional,
  217. NewYotogi,
  218. NewYotogiAdditional,
  219. LifeMode,
  220. LifeModeRecollection
  221. }
  222. }