protected override void InitWindowOnAwake() { GameObject buyBtn = MonoExtendUtil.FindDeepChild(this.gameObject, "DynamicPanel/BuyBtn").gameObject; GameObject cancelBtn = MonoExtendUtil.FindDeepChild(this.gameObject, "DynamicPanel/CancelBtn").gameObject; UIEventListener.Get(buyBtn).onClick = OnBuyBtnClick; UIEventListener.Get(cancelBtn).onClick = OnCancelBtnClick; }
public void OnContentUpdate(GameObject scrollView, GameObject go, object data) { PlayerScore itemData = data as PlayerScore; UILabel label = MonoExtendUtil.FindDeepChild <UILabel>(go, "ItemLab"); label.text = itemData.name + ": " + itemData.score; }
protected override void InitWindowOnAwake() { loopScrollView = MonoExtendUtil.FindDeepChild <UILoopScrollView>(this.gameObject, "DynamicPanel/ScorePanel"); GameObject backBtn = MonoExtendUtil.FindDeepChild(this.gameObject, "DynamicPanel/BackBtn").gameObject; loopScrollView.onContentUpdate = OnContentUpdate; loopScrollView.onContentClick = OnContentClick; UIEventListener.Get(backBtn).onClick = OnBackBtnClick; }
protected override void InitWindowOnAwake() { GameObject buyCoinBtn = MonoExtendUtil.FindDeepChild(this.gameObject, "DynamicPanel/BuyCoinBtn").gameObject; GameObject scoreBtn = MonoExtendUtil.FindDeepChild(this.gameObject, "DynamicPanel/PlayerScoreBtn").gameObject; GameObject msgBoxBtn = MonoExtendUtil.FindDeepChild(this.gameObject, "DynamicPanel/MsgBoxBtn").gameObject; GameObject backMenuBtn = MonoExtendUtil.FindDeepChild(this.gameObject, "DynamicPanel/BackMenuBtn").gameObject; UIEventListener.Get(buyCoinBtn).onClick = OnBuyCoinBtnClick; UIEventListener.Get(scoreBtn).onClick = OnScoreBtnClick; UIEventListener.Get(msgBoxBtn).onClick = OnMsgBoxBtnClick; UIEventListener.Get(backMenuBtn).onClick = OnBackMenuBtnClick; }
public static Component GetUIWidget(GameObject go, string childName, string type) { GameObject childObj = MonoExtendUtil.FindDeepChild(go, childName).gameObject; if (childObj == null) { return(null); } Type t = Type.GetType(type); return(childObj.GetComponent(t)); }
static int FindDeepChild(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject)); string arg1 = ToLua.CheckString(L, 2); UnityEngine.Transform o = MonoExtendUtil.FindDeepChild(arg0, arg1); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
protected override void Awake() { base.Awake(); grid = transform.GetComponentInChildren <UIBetterGrid>(); if (grid == null) { Debugger.LogError("Need UIBetterGrid Component!!"); return; } grid.onUpdateGrid = OnUpdateGrid; // 预创建缓存item根节点 cacheItemRoot = MonoExtendUtil.FindDeepChild(gameObject, CACHE_ITEM_ROOT); if (cacheItemRoot == null) { cacheItemRoot = new GameObject("CacheItemRoot").transform; MonoExtendUtil.AddChildToTarget(transform, cacheItemRoot); } }
protected override void InitWindowOnAwake() { GameObject okBtn = MonoExtendUtil.FindDeepChild(this.gameObject, "DynamicPanel/OkBtn").gameObject; UIEventListener.Get(okBtn).onClick = OnOkBtnClick; }
protected override void InitWindowOnAwake() { coinLab = MonoExtendUtil.FindDeepChild <UILabel>(this.gameObject, "DynamicPanel/CoinNumLab"); }