public override void Destroy() { this.cMgr = null; this.mLeftAnchor = null; this.mServerList = null; this.mRightAnchor = null; this.mRecommendServerIcon = null; this.mRecommendServerIcon_tex = null; this.mRecommendServerIcon_lab = null; this.mLastSelectServerIcon = null; this.mLastSelectServerIcon_tex = null; this.mLastSelectServerIcon_lab = null; this.mRecommendServerBtn = null; this.mLastSelectServerBtn = null; this.mServerListGrid = null; this.mBtnCache = null; this.mSelectedNow = null; this.mSelectedNow_tex = null; this.mSelectedNow_lab = null; this.mSelectedNow_stateBall = null; this.mSelectedNow_stateLabel = null; this.mListBtn = null; this.mConfirmBtn = null; Resources.UnloadAsset(this.atlas.texture); this.atlas = null; }
protected override void BindObject() { this.mLeftAnchor = this.transform.Find("LeftAnchor"); this.mServerList = this.transform.Find("ServerList"); this.mRightAnchor = this.transform.Find("RightAnchor"); this.mRecommendServerIcon = this.mLeftAnchor.FindChild("Recommend"); this.mRecommendServerIcon_tex = this.mRecommendServerIcon.FindChild("iconMain").GetComponent <UITexture>(); this.mRecommendServerIcon_lab = this.mRecommendServerIcon.FindChild("serverName").GetComponent <UILabel>(); this.mLastSelectServerIcon = this.mLeftAnchor.FindChild("LastSelect"); this.mLastSelectServerIcon_tex = this.mLastSelectServerIcon.FindChild("iconMain").GetComponent <UITexture>(); this.mLastSelectServerIcon_lab = this.mLastSelectServerIcon.FindChild("serverName").GetComponent <UILabel>(); this.mGoBackBtn = this.mLeftAnchor.FindChild("GoBack").GetComponent <UIButton>(); this.mAccNO = this.mLeftAnchor.FindChild("AccountNO/ACCNO").GetComponent <UILabel>(); this.mRecommendServerBtn = this.mServerList.FindChild("Scroll View/Fix_1/ServerBtn").GetComponent <AreaButtonCtrl>(); this.mLastSelectServerBtn = this.mServerList.FindChild("Scroll View/Fix_2/ServerBtn").GetComponent <AreaButtonCtrl>(); this.mServerListGrid = this.mServerList.FindChild("Scroll View/Grid").GetComponent <UIGrid>(); this.mServerListScrollView = this.mServerList.FindChild("Scroll View").GetComponent <UIPanel>(); this.mBtnCache = this.mServerListGrid.transform.FindChild("ServerBtnCache").gameObject; this.mSelectedNow = this.mRightAnchor.FindChild("MainIcon"); this.mSelectedNow_tex = this.mSelectedNow.FindChild("iconMain").GetComponent <UITexture>(); this.mSelectedNow_lab = this.mSelectedNow.FindChild("serverName").GetComponent <UILabel>(); this.mSelectedNow_stateBall = this.mSelectedNow.FindChild("serverState/stateBall").GetComponent <UISprite>(); this.mSelectedNow_stateLabel = this.mSelectedNow.FindChild("serverState/stateLabel").GetComponent <UILabel>(); this.mListBtn = this.mRightAnchor.FindChild("ServerListBtn").GetComponent <UIButton>(); this.mConfirmBtn = this.mRightAnchor.FindChild("LoginBtn").GetComponent <UIButton>(); this.mConfirmLabel = this.mConfirmBtn.transform.FindChild("Label").GetComponent <UILabel>(); this.atlas = this.mSelectedNow_stateBall.atlas; UIEventListener.Get(this.mListBtn.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnClickList); UIEventListener.Get(this.mConfirmBtn.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnClickConfirm); UIEventListener.Get(this.mRecommendServerIcon.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnClickRecommend); UIEventListener.Get(this.mLastSelectServerIcon.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnClickLastSelect); UIEventListener.Get(this.mGoBackBtn.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnClickGoBackBtn); }
private void InitBtnObject() { Dictionary <int, AreaInfo> dictionary = ModelManager.Instance.Get_AreaList_X(); if (dictionary.Count == 0) { ClientLogger.Error("没收到服务器数据"); CtrlManager.ShowMsgBox("错误", "无法获得服务器列表,请稍后再试", new Action(this.ExitGameCall), PopViewType.PopOneButton, "确定", "取消", null); } this.mBtnGridControllers.Clear(); foreach (KeyValuePair <int, AreaInfo> current in dictionary) { GameObject gameObject = NGUITools.AddChild(this.mServerListGrid.gameObject, this.mBtnCache); gameObject.SetActive(true); AreaButtonCtrl component = gameObject.GetComponent <AreaButtonCtrl>(); component.BindingAreaInfo(current.Value); this.mBtnGridControllers.Add(component); } this.mServerListGrid.Reposition(); }
private void SetBtnSelectState(string targetName, AreaButtonCtrl arg) { arg.SetChosen(arg.serverName == targetName); }