KasizukiPlayInfoCtrl.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace Kasizuki
  5. {
  6. public class KasizukiPlayInfoCtrl : NGUIWindow
  7. {
  8. public GameObject windowRoomList
  9. {
  10. get
  11. {
  12. return this.m_WindowRoomList;
  13. }
  14. }
  15. public GameObject windowManList
  16. {
  17. get
  18. {
  19. return this.m_WindowManList;
  20. }
  21. }
  22. public GameObject windowPlayList
  23. {
  24. get
  25. {
  26. return this.m_WindowPlayList;
  27. }
  28. }
  29. public GameObject windowDescriptionList
  30. {
  31. get
  32. {
  33. return this.m_WindowDesciption;
  34. }
  35. }
  36. public Action<RoomData.Data> onClickRoom { get; set; }
  37. public Action<ManData.Data> onClickMan { get; set; }
  38. public Action<PlayData.Data> onClickPlay { get; set; }
  39. public Action<PlayData.Data> onHoverPlay { get; set; }
  40. public Action<PlayData.Data> onOutPlay { get; set; }
  41. public ObjectCacheDic descriptionCache
  42. {
  43. get
  44. {
  45. return this.m_DescriptionCache;
  46. }
  47. }
  48. private void Start()
  49. {
  50. this.SetUpRoomList();
  51. this.SetUpManList();
  52. this.SetUpPlayList();
  53. this.SetUpDescription();
  54. }
  55. private void SetUpRoomList()
  56. {
  57. this.m_RoomListCache = new ObjectCacheDic();
  58. }
  59. private void SetUpManList()
  60. {
  61. this.m_ManListCache = new ObjectCacheDic();
  62. }
  63. private void SetUpPlayList()
  64. {
  65. this.m_PlayListCache = new ObjectCacheDic();
  66. }
  67. private void SetUpDescription()
  68. {
  69. this.m_DescriptionCache = new ObjectCacheDic();
  70. this.m_DescriptionCache.CacheChildObject<UILabel>(this.m_WindowDesciption, "Text Description", "説明文");
  71. this.m_DescriptionCache.CacheChildObject<uGUIListViewer>(this.m_WindowDesciption, "Parent Condition", "条件一覧");
  72. }
  73. public void OpenRoomList(List<RoomData.Data> roomDataList, RoomData.Data selectingData = null)
  74. {
  75. KasizukiPlayInfoCtrl.<OpenRoomList>c__AnonStorey1 <OpenRoomList>c__AnonStorey = new KasizukiPlayInfoCtrl.<OpenRoomList>c__AnonStorey1();
  76. <OpenRoomList>c__AnonStorey.selectingData = selectingData;
  77. <OpenRoomList>c__AnonStorey.$this = this;
  78. ListViewerWindow component = this.m_WindowRoomList.GetComponent<ListViewerWindow>();
  79. component.Show<RoomData.Data, UIWFTabButton>(roomDataList, delegate(int index, RoomData.Data data, UIWFTabButton item)
  80. {
  81. UILabel componentInChildren = item.GetComponentInChildren<UILabel>();
  82. componentInChildren.text = data.drawName;
  83. EventDelegate.Add(item.onClick, delegate()
  84. {
  85. <OpenRoomList>c__AnonStorey.OnClickRoom(data);
  86. });
  87. if (<OpenRoomList>c__AnonStorey.selectingData != null && <OpenRoomList>c__AnonStorey.selectingData == data)
  88. {
  89. item.SetSelect(true);
  90. }
  91. });
  92. UIWFTabPanel component2 = component.viewer.parentItemArea.GetComponent<UIWFTabPanel>();
  93. if (component2)
  94. {
  95. component2.UpdateChildren();
  96. }
  97. }
  98. public void OnClickRoom(RoomData.Data roomData)
  99. {
  100. if (this.onClickRoom != null)
  101. {
  102. this.onClickRoom(roomData);
  103. }
  104. }
  105. public void OpenManList(List<ManData.Data> manDataList, ManData.Data selectingData = null, Action<UIWFTabButton, ManData.Data> onCreate = null)
  106. {
  107. KasizukiPlayInfoCtrl.<OpenManList>c__AnonStorey3 <OpenManList>c__AnonStorey = new KasizukiPlayInfoCtrl.<OpenManList>c__AnonStorey3();
  108. <OpenManList>c__AnonStorey.selectingData = selectingData;
  109. <OpenManList>c__AnonStorey.onCreate = onCreate;
  110. <OpenManList>c__AnonStorey.$this = this;
  111. ListViewerWindow component = this.m_WindowManList.GetComponent<ListViewerWindow>();
  112. component.Show<ManData.Data, UIWFTabButton>(manDataList, delegate(int index, ManData.Data data, UIWFTabButton item)
  113. {
  114. UILabel componentInChildren = item.GetComponentInChildren<UILabel>();
  115. componentInChildren.text = data.drawName;
  116. EventDelegate.Add(item.onClick, delegate()
  117. {
  118. <OpenManList>c__AnonStorey.OnClickMan(data);
  119. });
  120. if (<OpenManList>c__AnonStorey.selectingData != null && <OpenManList>c__AnonStorey.selectingData == data)
  121. {
  122. item.SetSelect(true);
  123. }
  124. if (<OpenManList>c__AnonStorey.onCreate != null)
  125. {
  126. <OpenManList>c__AnonStorey.onCreate(item, data);
  127. }
  128. });
  129. UIWFTabPanel component2 = component.viewer.parentItemArea.GetComponent<UIWFTabPanel>();
  130. if (component2)
  131. {
  132. component2.UpdateChildren();
  133. }
  134. }
  135. public void OnClickMan(ManData.Data manData)
  136. {
  137. if (this.onClickMan != null)
  138. {
  139. this.onClickMan(manData);
  140. }
  141. }
  142. public void OpenPlayList(List<PlayData.Data> playDataList, PlayData.Data selectingData = null)
  143. {
  144. KasizukiPlayInfoCtrl.<OpenPlayList>c__AnonStorey5 <OpenPlayList>c__AnonStorey = new KasizukiPlayInfoCtrl.<OpenPlayList>c__AnonStorey5();
  145. <OpenPlayList>c__AnonStorey.selectingData = selectingData;
  146. <OpenPlayList>c__AnonStorey.$this = this;
  147. ListViewerWindow component = this.m_WindowPlayList.GetComponent<ListViewerWindow>();
  148. component.Show<PlayData.Data, UIWFTabButton>(playDataList, delegate(int index, PlayData.Data data, UIWFTabButton item)
  149. {
  150. UILabel componentInChildren = item.GetComponentInChildren<UILabel>();
  151. componentInChildren.text = data.drawName;
  152. EventDelegate.Add(item.onClick, delegate()
  153. {
  154. <OpenPlayList>c__AnonStorey.OnClickPlay(data);
  155. });
  156. EventDelegate.Add(item.GetComponent<UIEventTrigger>().onHoverOver, delegate()
  157. {
  158. <OpenPlayList>c__AnonStorey.OnHoverPlay(data);
  159. });
  160. EventDelegate.Add(item.GetComponent<UIEventTrigger>().onHoverOut, delegate()
  161. {
  162. <OpenPlayList>c__AnonStorey.OnOutPlay(data);
  163. });
  164. EventDelegate.Add(item.transform.Find("hover event").GetComponent<UIEventTrigger>().onHoverOver, delegate()
  165. {
  166. <OpenPlayList>c__AnonStorey.OnHoverPlay(data);
  167. });
  168. EventDelegate.Add(item.transform.Find("hover event").GetComponent<UIEventTrigger>().onHoverOut, delegate()
  169. {
  170. <OpenPlayList>c__AnonStorey.OnOutPlay(data);
  171. });
  172. if (<OpenPlayList>c__AnonStorey.selectingData != null && <OpenPlayList>c__AnonStorey.selectingData == data)
  173. {
  174. item.SetSelect(true);
  175. }
  176. item.isEnabled = data.IsPassed;
  177. });
  178. UIWFTabPanel component2 = component.viewer.parentItemArea.GetComponent<UIWFTabPanel>();
  179. if (component2)
  180. {
  181. component2.UpdateChildren();
  182. }
  183. }
  184. public void OnClickPlay(PlayData.Data playData)
  185. {
  186. if (this.onClickPlay != null)
  187. {
  188. this.onClickPlay(playData);
  189. }
  190. }
  191. private void OnHoverPlay(PlayData.Data playData)
  192. {
  193. if (this.onHoverPlay != null)
  194. {
  195. this.onHoverPlay(playData);
  196. }
  197. }
  198. private void OnOutPlay(PlayData.Data playData)
  199. {
  200. if (this.onOutPlay != null)
  201. {
  202. this.onOutPlay(playData);
  203. }
  204. }
  205. [SerializeField]
  206. private GameObject m_WindowRoomList;
  207. [SerializeField]
  208. private GameObject m_WindowManList;
  209. [SerializeField]
  210. private GameObject m_WindowPlayList;
  211. [SerializeField]
  212. private GameObject m_WindowDesciption;
  213. private ObjectCacheDic m_RoomListCache;
  214. private ObjectCacheDic m_ManListCache;
  215. private ObjectCacheDic m_PlayListCache;
  216. private ObjectCacheDic m_DescriptionCache;
  217. }
  218. }