SceneCharacterSelect.cs 6.6 KB

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