KasizukiPlayInfoCtrl.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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. ListViewerWindow component = this.m_WindowRoomList.GetComponent<ListViewerWindow>();
  76. component.Show<RoomData.Data, UIWFTabButton>(roomDataList, delegate(int index, RoomData.Data data, UIWFTabButton item)
  77. {
  78. UILabel componentInChildren = item.GetComponentInChildren<UILabel>();
  79. componentInChildren.text = data.drawName;
  80. EventDelegate.Add(item.onClick, delegate
  81. {
  82. this.OnClickRoom(data);
  83. });
  84. if (selectingData != null && selectingData == data)
  85. {
  86. item.SetSelect(true);
  87. }
  88. });
  89. UIWFTabPanel component2 = component.viewer.parentItemArea.GetComponent<UIWFTabPanel>();
  90. if (component2)
  91. {
  92. component2.UpdateChildren();
  93. }
  94. }
  95. public void OnClickRoom(RoomData.Data roomData)
  96. {
  97. if (this.onClickRoom != null)
  98. {
  99. this.onClickRoom(roomData);
  100. }
  101. }
  102. public void OpenManList(List<ManData.Data> manDataList, ManData.Data selectingData = null, Action<UIWFTabButton, ManData.Data> onCreate = null)
  103. {
  104. ListViewerWindow component = this.m_WindowManList.GetComponent<ListViewerWindow>();
  105. component.Show<ManData.Data, UIWFTabButton>(manDataList, delegate(int index, ManData.Data data, UIWFTabButton item)
  106. {
  107. UILabel componentInChildren = item.GetComponentInChildren<UILabel>();
  108. componentInChildren.text = data.drawName;
  109. EventDelegate.Add(item.onClick, delegate
  110. {
  111. this.OnClickMan(data);
  112. });
  113. if (selectingData != null && selectingData == data)
  114. {
  115. item.SetSelect(true);
  116. }
  117. if (onCreate != null)
  118. {
  119. onCreate(item, data);
  120. }
  121. });
  122. UIWFTabPanel component2 = component.viewer.parentItemArea.GetComponent<UIWFTabPanel>();
  123. if (component2)
  124. {
  125. component2.UpdateChildren();
  126. }
  127. }
  128. public void OnClickMan(ManData.Data manData)
  129. {
  130. if (this.onClickMan != null)
  131. {
  132. this.onClickMan(manData);
  133. }
  134. }
  135. public void OpenPlayList(List<PlayData.Data> playDataList, PlayData.Data selectingData = null)
  136. {
  137. ListViewerWindow component = this.m_WindowPlayList.GetComponent<ListViewerWindow>();
  138. component.Show<PlayData.Data, UIWFTabButton>(playDataList, delegate(int index, PlayData.Data data, UIWFTabButton item)
  139. {
  140. UILabel componentInChildren = item.GetComponentInChildren<UILabel>();
  141. componentInChildren.text = data.drawName;
  142. EventDelegate.Add(item.onClick, delegate
  143. {
  144. this.OnClickPlay(data);
  145. });
  146. EventDelegate.Add(item.GetComponent<UIEventTrigger>().onHoverOver, delegate
  147. {
  148. this.OnHoverPlay(data);
  149. });
  150. EventDelegate.Add(item.GetComponent<UIEventTrigger>().onHoverOut, delegate
  151. {
  152. this.OnOutPlay(data);
  153. });
  154. EventDelegate.Add(item.transform.Find("hover event").GetComponent<UIEventTrigger>().onHoverOver, delegate
  155. {
  156. this.OnHoverPlay(data);
  157. });
  158. EventDelegate.Add(item.transform.Find("hover event").GetComponent<UIEventTrigger>().onHoverOut, delegate
  159. {
  160. this.OnOutPlay(data);
  161. });
  162. if (selectingData != null && selectingData == data)
  163. {
  164. item.SetSelect(true);
  165. }
  166. item.isEnabled = data.IsPassed;
  167. });
  168. UIWFTabPanel component2 = component.viewer.parentItemArea.GetComponent<UIWFTabPanel>();
  169. if (component2)
  170. {
  171. component2.UpdateChildren();
  172. }
  173. }
  174. public void OnClickPlay(PlayData.Data playData)
  175. {
  176. if (this.onClickPlay != null)
  177. {
  178. this.onClickPlay(playData);
  179. }
  180. }
  181. private void OnHoverPlay(PlayData.Data playData)
  182. {
  183. if (this.onHoverPlay != null)
  184. {
  185. this.onHoverPlay(playData);
  186. }
  187. }
  188. private void OnOutPlay(PlayData.Data playData)
  189. {
  190. if (this.onOutPlay != null)
  191. {
  192. this.onOutPlay(playData);
  193. }
  194. }
  195. [SerializeField]
  196. private GameObject m_WindowRoomList;
  197. [SerializeField]
  198. private GameObject m_WindowManList;
  199. [SerializeField]
  200. private GameObject m_WindowPlayList;
  201. [SerializeField]
  202. private GameObject m_WindowDesciption;
  203. private ObjectCacheDic m_RoomListCache;
  204. private ObjectCacheDic m_ManListCache;
  205. private ObjectCacheDic m_PlayListCache;
  206. private ObjectCacheDic m_DescriptionCache;
  207. }
  208. }