protected override void InitUI(IUIData uiData = null) { mLibDrd = LibDrd.GetComponent <Dropdown>(); mConfigBtn_Pre = transform.Find("ConfigBtn_Pre").gameObject; mConfigGrid_Pre = transform.Find("ConfigGrid_Pre").gameObject; mData = uiData as UIFurnitureLibData ?? new UIFurnitureLibData(); mCurrentDropValue = mLibDrd.value; mLibDrd.options.Clear(); InitOpInfos(); }
protected override void RegisterUIEvent() { //返回按钮事件 ReturnBtn.onClick.AddListener(() => { UIMgr.OpenPanel <UIMainMenu>(); CloseSelf(); }); mLibDrd = LibDrd.GetComponent <Dropdown>(); EventTrigger trigger = mLibDrd.gameObject.AddComponent <EventTrigger>(); UnityAction <BaseEventData> action = new UnityAction <BaseEventData>(OnSelectDelegate); EventTrigger.Entry entry = new EventTrigger.Entry(); entry.eventID = EventTriggerType.Select; entry.callback.AddListener(action); trigger.triggers.Add(entry); }