using System; using System.Collections.Generic; using UnityEngine; using wf; namespace SceneEditWindow { public abstract class BaseIconWindow : BasePhotoWindow { public override void Awake() { base.Awake(); this.tabPanel = this.itemGrit.GetComponent(); NDebug.AssertNull(this.tabPanel); List list = this.CreateItemIdList(); for (int i = 0; i < list.Count; i++) { UIWFTabButton uiwftabButton = this.CreateItemObject(this.itemGrit.gameObject, list[i]); uiwftabButton.name = list[i].ToString(); this.tabButtonDic.Add(list[i], uiwftabButton); EventDelegate.Add(uiwftabButton.onSelect, delegate { if (!UIWFSelectButton.selected) { return; } this.OnSelectItem(int.Parse(UIWFSelectButton.current.name)); }); } Utility.ResetNGUI(this.itemGrit); UIScrollBar componentInChildren = base.GetComponentInChildren(); Utility.ResetNGUI(componentInChildren); this.UpdateChildren(); } protected abstract void OnSelectItem(int selectItemId); protected abstract UIWFTabButton CreateItemObject(GameObject parent, int createItemId); protected abstract List CreateItemIdList(); [SerializeField] public SceneEdit sceneEdit; [SerializeField] private UIGrid itemGrit; protected UIWFTabPanel tabPanel; protected Dictionary tabButtonDic = new Dictionary(); } }