KasizukiSaveAndLoadCtrl.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. using System;
  2. using System.Collections.Generic;
  3. using I2.Loc;
  4. using UnityEngine;
  5. using wf;
  6. namespace Kasizuki
  7. {
  8. public class KasizukiSaveAndLoadCtrl : NGUIWindow
  9. {
  10. private void Start()
  11. {
  12. if (this.m_IsStarted)
  13. {
  14. return;
  15. }
  16. this.SetUpSavePanel();
  17. this.SetUpLoadPanel();
  18. this.SetUpOtherButtons();
  19. this.SetUpDataUnits();
  20. this.m_NowOpenPage = SaveAndLoadMgr.PageNo.Page_1;
  21. this.m_IsStarted = true;
  22. }
  23. private void SetUpSavePanel()
  24. {
  25. this.m_CacheSaveObjects = new ObjectCacheDic();
  26. this.m_CacheSaveObjects.CacheChildObject<Component>(base.gameObject, "TitleGroup/TitleSave", "SavePanel");
  27. UIButton childObject = this.m_CacheSaveObjects.GetChildObject<UIButton>(base.gameObject, "DisplayButtonGroup/DisplayLoad");
  28. this.m_CacheSaveObjects.AddCache<UIButton>("LoadButton", childObject);
  29. EventDelegate.Add(childObject.onClick, delegate()
  30. {
  31. this.Open(SaveAndLoadMgr.ViewType.Load, true);
  32. });
  33. }
  34. private void SetUpLoadPanel()
  35. {
  36. this.m_CacheLoadObjects = new ObjectCacheDic();
  37. this.m_CacheLoadObjects.CacheChildObject<Component>(base.gameObject, "TitleGroup/TitleLoad", "LoadPanel");
  38. UIButton childObject = this.m_CacheLoadObjects.GetChildObject<UIButton>(base.gameObject, "DisplayButtonGroup/DisplaySave");
  39. this.m_CacheLoadObjects.AddCache<UIButton>("SaveButton", childObject);
  40. EventDelegate.Add(childObject.onClick, delegate()
  41. {
  42. this.Open(SaveAndLoadMgr.ViewType.Save, true);
  43. });
  44. }
  45. private void SetUpOtherButtons()
  46. {
  47. this.m_CacheButtons = new ObjectCacheDic();
  48. UIButton uibutton = this.m_CacheButtons.CacheChildObject<UIButton>(base.gameObject, "Cancel", "Cancel");
  49. EventDelegate.Add(uibutton.onClick, new EventDelegate.Callback(this.OnClickCancel));
  50. this.m_PageButtonDic = new Dictionary<SaveAndLoadMgr.PageNo, SaveAndLoadCtrl.PageButton>();
  51. this.m_InactiveColor = (this.m_ActiveColor = this.m_ListPageButtons.tempItem.GetComponent<UIWidget>().color);
  52. this.m_ActiveColor.a = 1f;
  53. this.m_ListPageButtons.Show<UIButton>(5, delegate(int index, UIButton button)
  54. {
  55. int num = index + 1;
  56. UISprite component = button.GetComponent<UISprite>();
  57. if (component != null)
  58. {
  59. component.spriteName = string.Format("{0}{1:00}", "cm3d2_save_load_page", num);
  60. }
  61. SaveAndLoadCtrl.PageButton buttonPage = new SaveAndLoadCtrl.PageButton();
  62. buttonPage.pageNo = (SaveAndLoadMgr.PageNo)Enum.Parse(typeof(SaveAndLoadMgr.PageNo), num.ToString());
  63. buttonPage.btnPageNo = button;
  64. buttonPage.selectCursor = button.transform.Find("SelectCursor").gameObject;
  65. this.m_PageButtonDic.Add(buttonPage.pageNo, buttonPage);
  66. EventDelegate.Add(button.onClick, delegate()
  67. {
  68. this.OnClickPageButton(buttonPage.pageNo);
  69. });
  70. });
  71. }
  72. private void SetUpDataUnits()
  73. {
  74. this.m_ListDataUnits.tempItem.AddComponent<KasizukiSaveAndLoadCtrl.DataUnitComp>();
  75. this.m_ListDataUnits.Show<KasizukiSaveAndLoadCtrl.DataUnitComp>(16, delegate(int index, KasizukiSaveAndLoadCtrl.DataUnitComp dataUnit)
  76. {
  77. dataUnit.Init(index);
  78. UIButton component = dataUnit.GetComponent<UIButton>();
  79. if (index == 0)
  80. {
  81. EventDelegate.Add(component.onClick, delegate()
  82. {
  83. this.OnClickNewGameUnit(dataUnit);
  84. });
  85. }
  86. else
  87. {
  88. EventDelegate.Add(component.onClick, delegate()
  89. {
  90. this.OnClickDataUnit(dataUnit);
  91. });
  92. }
  93. UIInput inputComment = dataUnit.inputComment;
  94. EventDelegate.Add(inputComment.onChange, delegate()
  95. {
  96. this.OnChangeDataUnitComment(dataUnit);
  97. });
  98. EventDelegate.Add(inputComment.onSubmit, new EventDelegate.Callback(inputComment.RemoveFocus));
  99. });
  100. }
  101. public void Open(SaveAndLoadMgr.ViewType viewType, bool isLatestPageOpen = false)
  102. {
  103. if (!this.m_IsStarted)
  104. {
  105. this.Start();
  106. }
  107. if (isLatestPageOpen)
  108. {
  109. int pageNumberLatestData = this.GetPageNumberLatestData();
  110. if (pageNumberLatestData > 0)
  111. {
  112. this.m_NowOpenPage = (SaveAndLoadMgr.PageNo)pageNumberLatestData;
  113. }
  114. else
  115. {
  116. this.m_NowOpenPage = SaveAndLoadMgr.PageNo.Page_1;
  117. }
  118. }
  119. if (viewType == SaveAndLoadMgr.ViewType.Save)
  120. {
  121. this.OpenSave();
  122. }
  123. else if (viewType == SaveAndLoadMgr.ViewType.Load)
  124. {
  125. this.OpenLoad();
  126. }
  127. else
  128. {
  129. NDebug.Assert("セーブロードのUIを開くときの種類に不正な値が入りました", false);
  130. Debug.LogError("セーブロードのUIを開くときの種類に不正な値が入りました");
  131. }
  132. this.m_NowViewType = viewType;
  133. this.OnClickPageButton(this.m_NowOpenPage);
  134. }
  135. private void OpenSave()
  136. {
  137. foreach (KeyValuePair<string, UnityEngine.Object> keyValuePair in this.m_CacheLoadObjects.Dic)
  138. {
  139. Component component = (Component)keyValuePair.Value;
  140. if (component && component.gameObject)
  141. {
  142. component.gameObject.SetActive(false);
  143. }
  144. else
  145. {
  146. Debug.LogWarningFormat("m_CacheLoadObjects の中に GameObject 以外のものが入っている\nキャッシュ名:{0}", new object[]
  147. {
  148. keyValuePair.Key
  149. });
  150. }
  151. }
  152. foreach (KeyValuePair<string, UnityEngine.Object> keyValuePair2 in this.m_CacheSaveObjects.Dic)
  153. {
  154. Component component2 = (Component)keyValuePair2.Value;
  155. if (component2 && component2.gameObject)
  156. {
  157. component2.gameObject.SetActive(true);
  158. }
  159. else
  160. {
  161. Debug.LogWarningFormat("m_CacheSaveObjects の中に GameObject 以外のものが入っている\nキャッシュ名:{0}", new object[]
  162. {
  163. keyValuePair2.Key
  164. });
  165. }
  166. }
  167. }
  168. private void OpenLoad()
  169. {
  170. foreach (KeyValuePair<string, UnityEngine.Object> keyValuePair in this.m_CacheSaveObjects.Dic)
  171. {
  172. Component component = (Component)keyValuePair.Value;
  173. if (component && component.gameObject)
  174. {
  175. component.gameObject.SetActive(false);
  176. }
  177. else
  178. {
  179. Debug.LogWarningFormat("m_CacheSaveObjects の中に GameObject 以外のものが入っている\nキャッシュ名:{0}", new object[]
  180. {
  181. keyValuePair.Key
  182. });
  183. }
  184. }
  185. foreach (KeyValuePair<string, UnityEngine.Object> keyValuePair2 in this.m_CacheLoadObjects.Dic)
  186. {
  187. Component component2 = (Component)keyValuePair2.Value;
  188. if (component2 && component2.gameObject)
  189. {
  190. component2.gameObject.SetActive(true);
  191. }
  192. else
  193. {
  194. Debug.LogWarningFormat("m_CacheLoadObjects の中に GameObject 以外のものが入っている\nキャッシュ名:{0}", new object[]
  195. {
  196. keyValuePair2.Key
  197. });
  198. }
  199. }
  200. }
  201. private void UpdateDataUnits()
  202. {
  203. if (this.m_NowViewType == SaveAndLoadMgr.ViewType.Save)
  204. {
  205. GameObject[] itemArray = this.m_ListDataUnits.ItemArray;
  206. for (int i = 0; i < itemArray.Length; i++)
  207. {
  208. int saveDataIndex = i + (this.m_NowOpenPage - SaveAndLoadMgr.PageNo.Page_1) * itemArray.Length;
  209. KasizukiManager.SaveDataHeader saveDataHeader = GameMain.Instance.KasizukiMgr.GetSaveDataHeader(saveDataIndex);
  210. KasizukiSaveAndLoadCtrl.DataUnitComp component = itemArray[i].GetComponent<KasizukiSaveAndLoadCtrl.DataUnitComp>();
  211. this.SetDataUnitAtHeader(component, saveDataHeader);
  212. UIButton component2 = component.GetComponent<UIButton>();
  213. if (i != 0)
  214. {
  215. component2.isEnabled = true;
  216. }
  217. else
  218. {
  219. component2.isEnabled = false;
  220. }
  221. }
  222. }
  223. else if (this.m_NowViewType == SaveAndLoadMgr.ViewType.Load)
  224. {
  225. GameObject[] itemArray2 = this.m_ListDataUnits.ItemArray;
  226. for (int j = 0; j < itemArray2.Length; j++)
  227. {
  228. int saveDataIndex2 = j + (this.m_NowOpenPage - SaveAndLoadMgr.PageNo.Page_1) * itemArray2.Length;
  229. KasizukiManager.SaveDataHeader saveDataHeader2 = GameMain.Instance.KasizukiMgr.GetSaveDataHeader(saveDataIndex2);
  230. KasizukiSaveAndLoadCtrl.DataUnitComp component3 = itemArray2[j].GetComponent<KasizukiSaveAndLoadCtrl.DataUnitComp>();
  231. this.SetDataUnitAtHeader(component3, saveDataHeader2);
  232. UIButton component4 = component3.GetComponent<UIButton>();
  233. if (j != 0)
  234. {
  235. component4.isEnabled = (saveDataHeader2 != null);
  236. }
  237. else
  238. {
  239. component4.isEnabled = true;
  240. }
  241. }
  242. }
  243. else
  244. {
  245. NDebug.Assert("セーブロードのUIを更新するときの種類に不正な値が入っていました", false);
  246. }
  247. }
  248. private void SetDataUnitAtHeader(KasizukiSaveAndLoadCtrl.DataUnitComp dataUnit, KasizukiManager.SaveDataHeader header)
  249. {
  250. NDebug.Assert(dataUnit != null, "セーブデータの項目にnullが指定されました");
  251. if (header != null)
  252. {
  253. dataUnit.content.SetActive(true);
  254. dataUnit.newLabel.SetActive(GameMain.Instance.KasizukiMgr.LatestSaveDataNumber == header.saveDataNumber);
  255. int id = header.lastManType;
  256. if (GameMain.Instance.CharacterMgr.status.lockNTRPlay)
  257. {
  258. id = 10;
  259. }
  260. ManData.Data data = ManData.GetData(id);
  261. dataUnit.labelDate.text = header.GetDateTime().ToString("yyyy.MM.dd HH:mm");
  262. dataUnit.labelMaidCount.text = KasizukiManager.GetEnableMaidList().Count.ToString();
  263. dataUnit.labelManName.text = data.drawName;
  264. if (Product.supportMultiLanguage)
  265. {
  266. Localize localize = dataUnit.labelManName.GetComponent<Localize>();
  267. if (localize == null)
  268. {
  269. localize = dataUnit.labelManName.gameObject.AddComponent<Localize>();
  270. }
  271. Utility.SetLocalizeTerm(localize, data.drawNameTerm, false);
  272. }
  273. dataUnit.labelUsedCount.text = header.playCount.ToString();
  274. dataUnit.inputComment.value = header.strComment;
  275. }
  276. else
  277. {
  278. dataUnit.content.SetActive(false);
  279. dataUnit.newLabel.SetActive(false);
  280. }
  281. if (dataUnit.index == 0)
  282. {
  283. dataUnit.newGameLabel.SetActive(true);
  284. }
  285. else
  286. {
  287. dataUnit.newGameLabel.SetActive(false);
  288. }
  289. }
  290. private int GetPageNumberLatestData()
  291. {
  292. int latestSaveDataNumber = GameMain.Instance.KasizukiMgr.LatestSaveDataNumber;
  293. return latestSaveDataNumber / 16 + 1;
  294. }
  295. private void OnClickPageButton(SaveAndLoadMgr.PageNo pageNo)
  296. {
  297. this.m_NowOpenPage = pageNo;
  298. this.UpdatePageButtons(pageNo);
  299. this.UpdateDataUnits();
  300. }
  301. private void UpdatePageButtons(SaveAndLoadMgr.PageNo pageNo)
  302. {
  303. foreach (KeyValuePair<SaveAndLoadMgr.PageNo, SaveAndLoadCtrl.PageButton> keyValuePair in this.m_PageButtonDic)
  304. {
  305. if (keyValuePair.Key == pageNo)
  306. {
  307. keyValuePair.Value.btnPageNo.defaultColor = this.m_ActiveColor;
  308. keyValuePair.Value.selectCursor.SetActive(true);
  309. }
  310. else
  311. {
  312. keyValuePair.Value.btnPageNo.defaultColor = this.m_InactiveColor;
  313. keyValuePair.Value.selectCursor.SetActive(false);
  314. }
  315. }
  316. }
  317. private void OnClickDataUnit(KasizukiSaveAndLoadCtrl.DataUnitComp dataUnit)
  318. {
  319. int saveSlot = dataUnit.index + (this.m_NowOpenPage - SaveAndLoadMgr.PageNo.Page_1) * 16;
  320. if (UICamera.currentTouchID != -2)
  321. {
  322. SaveAndLoadMgr.ViewType nowViewType = this.m_NowViewType;
  323. if (nowViewType != SaveAndLoadMgr.ViewType.Load)
  324. {
  325. if (nowViewType != SaveAndLoadMgr.ViewType.Save)
  326. {
  327. NDebug.Assert("セーブデータを開く種類に不正な値が入っていました", false);
  328. }
  329. else
  330. {
  331. string msg;
  332. if (GameMain.Instance.KasizukiMgr.IsExistSaveData(saveSlot))
  333. {
  334. msg = string.Format("{0}番に上書きして保存します。\n宜しいですか?", saveSlot);
  335. if (Product.supportMultiLanguage)
  336. {
  337. msg = "SceneKasizukiMainMenu/ダイアログ/上書きして保存します。宜しいですか?";
  338. }
  339. }
  340. else
  341. {
  342. msg = string.Format("{0}番にデータを保存しますか?", saveSlot);
  343. if (Product.supportMultiLanguage)
  344. {
  345. msg = "SceneKasizukiMainMenu/ダイアログ/データを保存しますか?";
  346. }
  347. }
  348. if (Product.supportMultiLanguage)
  349. {
  350. this.OpenDialogTerm(SystemDialog.TYPE.OK_CANCEL, msg, delegate
  351. {
  352. this.CloseDialog();
  353. this.Save(saveSlot);
  354. });
  355. }
  356. else
  357. {
  358. this.OpenDialog(SystemDialog.TYPE.OK_CANCEL, msg, delegate
  359. {
  360. this.CloseDialog();
  361. this.Save(saveSlot);
  362. });
  363. }
  364. }
  365. }
  366. else
  367. {
  368. string msg = string.Format("{0}番のデータをロードしますか?", saveSlot);
  369. if (Product.supportMultiLanguage)
  370. {
  371. this.OpenDialogTerm(SystemDialog.TYPE.OK_CANCEL, "Dialog/セーブロード/データをロードしますか?", delegate
  372. {
  373. this.CloseDialog();
  374. this.Load(saveSlot);
  375. });
  376. }
  377. else
  378. {
  379. this.OpenDialog(SystemDialog.TYPE.OK_CANCEL, msg, delegate
  380. {
  381. this.CloseDialog();
  382. this.Load(saveSlot);
  383. });
  384. }
  385. }
  386. return;
  387. }
  388. if (!GameMain.Instance.KasizukiMgr.IsExistSaveData(saveSlot))
  389. {
  390. return;
  391. }
  392. string msg2 = string.Format("SceneKasizukiMainMenu/ダイアログ/データを削除します。本当に宜しいですか。", new object[0]);
  393. this.OpenDialogTerm(SystemDialog.TYPE.OK_CANCEL, msg2, delegate
  394. {
  395. this.CloseDialog();
  396. this.Delete(saveSlot);
  397. });
  398. }
  399. private void OnClickNewGameUnit(KasizukiSaveAndLoadCtrl.DataUnitComp dataUnit)
  400. {
  401. if (dataUnit.index != 0)
  402. {
  403. return;
  404. }
  405. string msg = "SceneKasizukiMainMenu/ダイアログ/ここに新規顧客情報を登録します。";
  406. this.OpenDialogTerm(SystemDialog.TYPE.OK_CANCEL, msg, delegate
  407. {
  408. this.CloseDialog();
  409. this.NewGame();
  410. });
  411. }
  412. private void OnChangeDataUnitComment(KasizukiSaveAndLoadCtrl.DataUnitComp dataUnit)
  413. {
  414. int saveDataIndex = dataUnit.index + (this.m_NowOpenPage - SaveAndLoadMgr.PageNo.Page_1) * 16;
  415. KasizukiManager.SaveDataHeader saveDataHeader = GameMain.Instance.KasizukiMgr.GetSaveDataHeader(saveDataIndex);
  416. saveDataHeader.strComment = dataUnit.inputComment.value;
  417. }
  418. private void OnClickCancel()
  419. {
  420. if (this.onClickCancel != null)
  421. {
  422. this.onClickCancel();
  423. }
  424. }
  425. private void OpenDialog(SystemDialog.TYPE openType, string msg, Action onOK)
  426. {
  427. GameMain.Instance.SysDlg.Show(msg, openType, delegate
  428. {
  429. if (onOK != null)
  430. {
  431. onOK();
  432. }
  433. }, new SystemDialog.OnClick(this.CloseDialog));
  434. }
  435. private void OpenDialogTerm(SystemDialog.TYPE openType, string msg, Action onOK)
  436. {
  437. GameMain.Instance.SysDlg.ShowFromLanguageTerm(msg, null, openType, delegate
  438. {
  439. if (onOK != null)
  440. {
  441. onOK();
  442. }
  443. }, new SystemDialog.OnClick(this.CloseDialog));
  444. }
  445. private void CloseDialog()
  446. {
  447. GameMain.Instance.SysDlg.Close();
  448. }
  449. private void Save(int saveSlot)
  450. {
  451. GameMain.Instance.KasizukiMgr.SerializeLocal(saveSlot);
  452. this.Open(SaveAndLoadMgr.ViewType.Save, false);
  453. if (this.onSave != null)
  454. {
  455. this.onSave();
  456. }
  457. this.OpenDialogTerm(SystemDialog.TYPE.OK, "SceneKasizukiMainMenu/ダイアログ/データを保存しました。", new Action(this.CloseDialog));
  458. }
  459. private void Load(int saveSlot)
  460. {
  461. GameMain.Instance.KasizukiMgr.DeserializeLocal(saveSlot);
  462. if (this.onLoad != null)
  463. {
  464. this.onLoad();
  465. }
  466. }
  467. private void Delete(int saveSlot)
  468. {
  469. GameMain.Instance.KasizukiMgr.DeleteSaveDataLocal(saveSlot);
  470. this.Open(this.m_NowViewType, false);
  471. if (this.onDelete != null)
  472. {
  473. this.onDelete();
  474. }
  475. this.OpenDialogTerm(SystemDialog.TYPE.OK, "SceneKasizukiMainMenu/ダイアログ/データを削除しました。", new Action(this.CloseDialog));
  476. }
  477. private void NewGame()
  478. {
  479. GameMain.Instance.KasizukiMgr.CreateNewData();
  480. if (this.onClickNewGame != null)
  481. {
  482. this.onClickNewGame();
  483. }
  484. }
  485. private void OnDestroy()
  486. {
  487. this.onClickCancel = null;
  488. this.onClickNewGame = null;
  489. this.onLoad = null;
  490. this.onSave = null;
  491. this.onDelete = null;
  492. }
  493. public Action onClickCancel { get; set; }
  494. public Action onClickNewGame { get; set; }
  495. public Action onLoad { get; set; }
  496. public Action onSave { get; set; }
  497. public Action onDelete { get; set; }
  498. private const int PAGE_BUTTON_COUNT = 5;
  499. private const int PAGE_DATA_COUNT = 16;
  500. private const string STR_PAGE_BUTTON_NAME = "cm3d2_save_load_page";
  501. private const string DIALOG_MESSAGE_TO_SAVE_NORMAL = "{0}番にデータを保存しますか?";
  502. private const string DIALOG_MESSAGE_TO_SAVE_NORMAL_TERM = "SceneKasizukiMainMenu/ダイアログ/データを保存しますか?";
  503. private const string DIALOG_MESSAGE_TO_SAVE_OVERWRITE = "{0}番に上書きして保存します。\n宜しいですか?";
  504. private const string DIALOG_MESSAGE_TO_SAVE_OVERWRITE_TERM = "SceneKasizukiMainMenu/ダイアログ/上書きして保存します。宜しいですか?";
  505. private const string DIALOG_MESSAGE_TO_LOAD = "{0}番のデータをロードしますか?";
  506. private const string DIALOG_MESSAGE_TO_LOAD_TERM = "Dialog/セーブロード/データをロードしますか?";
  507. private const string DIALOG_MESSAGE_TO_DELETE = "SceneKasizukiMainMenu/ダイアログ/データを削除します。本当に宜しいですか。";
  508. private const string DIALOG_MESSAGE_RESULT_SAVE = "SceneKasizukiMainMenu/ダイアログ/データを保存しました。";
  509. private const string DIALOG_MESSAGE_RESULT_DELETE = "SceneKasizukiMainMenu/ダイアログ/データを削除しました。";
  510. private const string DIALOG_MESSAGE_TO_NEW_GAME = "SceneKasizukiMainMenu/ダイアログ/ここに新規顧客情報を登録します。";
  511. private bool m_IsStarted;
  512. [SerializeField]
  513. private uGUIListViewer m_ListPageButtons;
  514. [SerializeField]
  515. private uGUIListViewer m_ListDataUnits;
  516. private SaveAndLoadMgr.PageNo m_NowOpenPage;
  517. private SaveAndLoadMgr.ViewType m_NowViewType;
  518. private ObjectCacheDic m_CacheSaveObjects;
  519. private ObjectCacheDic m_CacheLoadObjects;
  520. private ObjectCacheDic m_CacheButtons;
  521. private Color m_ActiveColor;
  522. private Color m_InactiveColor;
  523. private Dictionary<SaveAndLoadMgr.PageNo, SaveAndLoadCtrl.PageButton> m_PageButtonDic;
  524. public class DataUnitComp : MonoBehaviour
  525. {
  526. public int index { get; private set; }
  527. public void Awake()
  528. {
  529. this.SetUpCache();
  530. }
  531. protected virtual void SetUpCache()
  532. {
  533. this.content = UTY.GetChildObject(base.gameObject, "Content", false);
  534. this.labelDate = UTY.GetChildObject(this.content, "DataInfo/Date", false).GetComponent<UILabel>();
  535. this.labelUsedCount = UTY.GetChildObject(this.content, "DataInfo/UsedCount/Number", false).GetComponent<UILabel>();
  536. this.labelManName = UTY.GetChildObject(this.content, "DataInfo/Man/Name", false).GetComponent<UILabel>();
  537. this.labelMaidCount = UTY.GetChildObject(this.content, "DataInfo/NumberOfEmployees/Number", false).GetComponent<UILabel>();
  538. this.inputComment = UTY.GetChildObject(this.content, "Comment/InputField", false).GetComponent<UIInput>();
  539. this.selectCursor = UTY.GetChildObject(this.content, "SelectCursor", false);
  540. this.newLabel = UTY.GetChildObject(base.gameObject, "NewLabel", false);
  541. this.newGameLabel = UTY.GetChildObject(base.gameObject, "NewGameLabel", false);
  542. }
  543. public void Init(int index)
  544. {
  545. if (this.isInit)
  546. {
  547. Debug.Log("セーブデータ項目{0}番目は既に Init() 関数を呼ばれています。\n処理を行いません。");
  548. return;
  549. }
  550. this.index = index;
  551. this.isInit = true;
  552. }
  553. public UILabel labelDate;
  554. public UILabel labelUsedCount;
  555. public UILabel labelManName;
  556. public UILabel labelMaidCount;
  557. public UIInput inputComment;
  558. public GameObject selectCursor;
  559. public GameObject newLabel;
  560. public GameObject newGameLabel;
  561. public GameObject content;
  562. private bool isInit;
  563. }
  564. }
  565. }