KasizukiSaveAndLoadCtrl.cs 19 KB

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