private void OnSoulReliquaryChanged(bool isCheck) { if (isCheck) { if (this.mGUISoulReliquaryInfo == null) { GameObject gameObject = Res.LoadGUI("GUI/GUIActivitySoulReliquary"); if (gameObject == null) { global::Debug.LogError(new object[] { "Res.Load GUI/GUIActivitySoulReliquary error" }); return; } GameObject gameObject2 = (GameObject)UnityEngine.Object.Instantiate(gameObject); gameObject2.name = gameObject.name; gameObject2.transform.parent = this.mWinBg; gameObject2.transform.localPosition = new Vector3(0f, 36f, 0f); gameObject2.transform.localScale = Vector3.one; this.mGUISoulReliquaryInfo = gameObject2.AddComponent<GUISoulReliquaryInfo>(); this.mGUISoulReliquaryInfo.InitWithBaseScene(this, this.mTabSoulReliquary); this.mTabSoulReliquary.ActivateObj = gameObject2; Globals.Instance.CliSession.Register(225, new ClientSession.MsgHandler(this.mGUISoulReliquaryInfo.OnMsgRoll)); } this.mGUISoulReliquaryInfo.Refresh(); } }
public void Init(MS2C_LuckyRoll reply, UnityEngine.Object basescene) { this.mRewardItems = new List<GUIRollRewardsWindow.RewardItem>(); foreach (OpenLootData current in reply.Data) { if (current.InfoID != 0) { this.mRewardItems.Add(new GUIRollRewardsWindow.RewardItem { infoID = current.InfoID, count = current.Count }); } } foreach (ulong current2 in reply.PetIDs) { if (current2 != 0uL) { this.mRewardItems.Add(new GUIRollRewardsWindow.RewardItem { rewardType = GUIRollRewardsWindow.ERollRewardType.ERT_Pet, GUID = current2, count = 1u }); } } if (basescene is GUISoulReliquaryInfo) { if (this.baseSoulReliquaryLayer != null) { this.Refresh(); return; } this.baseSoulReliquaryLayer = (GUISoulReliquaryInfo)basescene; } else if (basescene is GUIRewardLuckyDrawInfo) { if (this.baseRewardLuckyDrawInfo != null) { this.Refresh(); return; } this.baseRewardLuckyDrawInfo = (GUIRewardLuckyDrawInfo)basescene; } this.rewardsList = new List<GameObject>(); this.rewards = GameUITools.FindGameObject("Rewards", base.gameObject); this.mBG = GameUITools.FindUISprite("BG", base.gameObject); this.window = GameUITools.FindGameObject("Window", base.gameObject); this.buttonGroup = GameUITools.FindGameObject("ButtonGroup", this.window); this.OKBtn = GameUITools.FindGameObject("OK", this.buttonGroup); this.AgainBtn = GameUITools.FindGameObject("Again", this.buttonGroup); UIEventListener expr_1E1 = UIEventListener.Get(this.OKBtn); expr_1E1.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_1E1.onClick, new UIEventListener.VoidDelegate(this.OnOKClick)); UIEventListener expr_20D = UIEventListener.Get(this.AgainBtn); expr_20D.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_20D.onClick, new UIEventListener.VoidDelegate(this.OnAgainClick)); if (this.baseRewardLuckyDrawInfo != null) { this.InitRollWindow(); } else if (this.baseSoulReliquaryLayer != null) { this.InitSoulReliquaryWindow(); } }