using System; using System.Collections.Generic; using UnityEngine; namespace Kasizuki { public class KasizukiPlayInfoCtrl : NGUIWindow { public GameObject windowRoomList { get { return this.m_WindowRoomList; } } public GameObject windowManList { get { return this.m_WindowManList; } } public GameObject windowPlayList { get { return this.m_WindowPlayList; } } public GameObject windowDescriptionList { get { return this.m_WindowDesciption; } } public Action onClickRoom { get; set; } public Action onClickMan { get; set; } public Action onClickPlay { get; set; } public Action onHoverPlay { get; set; } public Action onOutPlay { get; set; } public ObjectCacheDic descriptionCache { get { return this.m_DescriptionCache; } } private void Start() { this.SetUpRoomList(); this.SetUpManList(); this.SetUpPlayList(); this.SetUpDescription(); } private void SetUpRoomList() { this.m_RoomListCache = new ObjectCacheDic(); } private void SetUpManList() { this.m_ManListCache = new ObjectCacheDic(); } private void SetUpPlayList() { this.m_PlayListCache = new ObjectCacheDic(); } private void SetUpDescription() { this.m_DescriptionCache = new ObjectCacheDic(); this.m_DescriptionCache.CacheChildObject(this.m_WindowDesciption, "Text Description", "説明文"); this.m_DescriptionCache.CacheChildObject(this.m_WindowDesciption, "Parent Condition", "条件一覧"); } public void OpenRoomList(List roomDataList, RoomData.Data selectingData = null) { ListViewerWindow component = this.m_WindowRoomList.GetComponent(); component.Show(roomDataList, delegate(int index, RoomData.Data data, UIWFTabButton item) { UILabel componentInChildren = item.GetComponentInChildren(); componentInChildren.text = data.drawName; EventDelegate.Add(item.onClick, delegate { this.OnClickRoom(data); }); if (selectingData != null && selectingData == data) { item.SetSelect(true); } }); UIWFTabPanel component2 = component.viewer.parentItemArea.GetComponent(); if (component2) { component2.UpdateChildren(); } } public void OnClickRoom(RoomData.Data roomData) { if (this.onClickRoom != null) { this.onClickRoom(roomData); } } public void OpenManList(List manDataList, ManData.Data selectingData = null, Action onCreate = null) { ListViewerWindow component = this.m_WindowManList.GetComponent(); component.Show(manDataList, delegate(int index, ManData.Data data, UIWFTabButton item) { UILabel componentInChildren = item.GetComponentInChildren(); componentInChildren.text = data.drawName; EventDelegate.Add(item.onClick, delegate { this.OnClickMan(data); }); if (selectingData != null && selectingData == data) { item.SetSelect(true); } if (onCreate != null) { onCreate(item, data); } }); UIWFTabPanel component2 = component.viewer.parentItemArea.GetComponent(); if (component2) { component2.UpdateChildren(); } } public void OnClickMan(ManData.Data manData) { if (this.onClickMan != null) { this.onClickMan(manData); } } public void OpenPlayList(List playDataList, PlayData.Data selectingData = null) { ListViewerWindow component = this.m_WindowPlayList.GetComponent(); component.Show(playDataList, delegate(int index, PlayData.Data data, UIWFTabButton item) { UILabel componentInChildren = item.GetComponentInChildren(); componentInChildren.text = data.drawName; EventDelegate.Add(item.onClick, delegate { this.OnClickPlay(data); }); EventDelegate.Add(item.GetComponent().onHoverOver, delegate { this.OnHoverPlay(data); }); EventDelegate.Add(item.GetComponent().onHoverOut, delegate { this.OnOutPlay(data); }); EventDelegate.Add(item.transform.Find("hover event").GetComponent().onHoverOver, delegate { this.OnHoverPlay(data); }); EventDelegate.Add(item.transform.Find("hover event").GetComponent().onHoverOut, delegate { this.OnOutPlay(data); }); if (selectingData != null && selectingData == data) { item.SetSelect(true); } item.isEnabled = data.IsPassed; }); UIWFTabPanel component2 = component.viewer.parentItemArea.GetComponent(); if (component2) { component2.UpdateChildren(); } } public void OnClickPlay(PlayData.Data playData) { if (this.onClickPlay != null) { this.onClickPlay(playData); } } private void OnHoverPlay(PlayData.Data playData) { if (this.onHoverPlay != null) { this.onHoverPlay(playData); } } private void OnOutPlay(PlayData.Data playData) { if (this.onOutPlay != null) { this.onOutPlay(playData); } } [SerializeField] private GameObject m_WindowRoomList; [SerializeField] private GameObject m_WindowManList; [SerializeField] private GameObject m_WindowPlayList; [SerializeField] private GameObject m_WindowDesciption; private ObjectCacheDic m_RoomListCache; private ObjectCacheDic m_ManListCache; private ObjectCacheDic m_PlayListCache; private ObjectCacheDic m_DescriptionCache; } }