public static WGShopView CreateShopView() { if (mObj == null) { mObj = Resources.Load("pbWGShopView"); } if (mObj != null) { GameObject go = Instantiate(mObj) as GameObject; WGShopView sv = go.GetComponent <WGShopView>(); curShopView = sv; return(sv); } return(null); }
public void ViewControllerDoAct(BTN_ACT act, System.Action <MDAlertBehaviour, VIEW_STATE> myCallBack = null) { switch (act) { case BTN_ACT.ITEM: mViewState = VIEW_STATE.ITEM; currentViewCtrl = WGItemView.CreateItemView(); break; case BTN_ACT.MONSTER: mViewState = VIEW_STATE.ITEM; currentViewCtrl = WGItemView.CreateItemView(true); break; case BTN_ACT.SHOP: mViewState = VIEW_STATE.SHOP; currentViewCtrl = WGShopView.CreateShopView(); break; case BTN_ACT.Achievement: mViewState = VIEW_STATE.Achievement; currentViewCtrl = WGAchievementView.CreateAchievementView(); break; case BTN_ACT.OTHER: mViewState = VIEW_STATE.OTHER; currentViewCtrl = WGHelpView.CreateHelpView(); break; case BTN_ACT.HuaFei: mViewState = VIEW_STATE.HuaFei; currentViewCtrl = V2DuiHuaFeiView.CreateDuiHuaFeiView(); break; // case BTN_ACT.Sign: // mViewState = VIEW_STATE.Sign; // currentViewCtrl = WGDailyRewardView.CreateDailyView(); // break; } mTempViewState = mViewState; SDK.AddChild(currentViewCtrl.gameObject, WGRootManager.Self.goRootGameUI); currentViewCtrl.showView(); currentViewCtrl.alertViewBehavriour = (ab, view) => { if (myCallBack != null) { myCallBack(ab, mViewState); } freshMenuButton(); switch (ab) { case MDAlertBehaviour.DID_SHOW: break; case MDAlertBehaviour.DID_HIDDEN: if (mTempViewState != VIEW_STATE.HuaFei) { if (YeHuoSDK.bShowLuckGift) //close window lucky { WGGameWorld.Instance.ShowLuckyDaLiBao(); } } if (currentViewCtrl == view) { currentViewCtrl = null; } Destroy(view.gameObject); mTempViewState = VIEW_STATE.NONE; break; case MDAlertBehaviour.CLICK_OK: mViewState = VIEW_STATE.NONE; view.hiddenView(); break; } }; }