コード例 #1
0
 public void InitData(GUIRewardFlashSaleInfo basescene, int slot, string name, string detail, int preCost, int curCost, int count)
 {
     this.mBaseScene = basescene;
     this.slot = slot;
     this.curCost = curCost;
     this.detail = detail;
     this.mMoney.text = curCost.ToString();
     this.mOriginalCost.text = preCost.ToString();
     this.mTitle.text = name;
     this.Refresh(count);
 }
コード例 #2
0
ファイル: GUIReward.cs プロジェクト: floatyears/Decrypt
 private void OnActivityCheckBtnsChanged(bool isCheck)
 {
     if (GUIRewardCheckBtn.mCurrent.IsChecked)
     {
         switch (GUIRewardCheckBtn.mCurrent.ActivityType)
         {
         case EActivityType.EAT_Dart:
             if (this.mGUIRewardDartInfo == null)
             {
                 GameObject gameObject = Res.LoadGUI("GUI/GUIActivityDart");
                 if (gameObject == null)
                 {
                     global::Debug.LogError(new object[]
                     {
                         "Res.Load GUI/GUIActivityDart error"
                     });
                     return;
                 }
                 GameObject gameObject2 = (GameObject)UnityEngine.Object.Instantiate(gameObject);
                 gameObject2.name = gameObject.name;
                 gameObject2.transform.parent = this.mWinBg;
                 gameObject2.transform.localPosition = new Vector3(170f, -59f, 0f);
                 gameObject2.transform.localScale = Vector3.one;
                 this.mGUIRewardDartInfo = gameObject2.AddComponent<GUIRewardDartInfo>();
                 this.mGUIRewardDartInfo.InitWithBaseScene(this, GUIRewardCheckBtn.mCurrent);
                 Globals.Instance.CliSession.Register(701, new ClientSession.MsgHandler(this.mGUIRewardDartInfo.OnMsgGetDartData));
                 Globals.Instance.CliSession.Register(703, new ClientSession.MsgHandler(this.mGUIRewardDartInfo.OnMsgStartDart));
                 GUIRewardCheckBtn.mCurrent.ActivateObj = this.mGUIRewardDartInfo.gameObject;
             }
             this.mGUIRewardDartInfo.Refresh();
             break;
         case EActivityType.EAT_LuckyDraw:
             if (this.mGUIRewardLuckyDrawInfo == null)
             {
                 GameObject gameObject3 = Res.LoadGUI("GUI/GUIActivityLuckyDraw");
                 if (gameObject3 == null)
                 {
                     global::Debug.LogError(new object[]
                     {
                         "Res.Load GUI/GUIActivityLuckyDraw error"
                     });
                     return;
                 }
                 GameObject gameObject4 = (GameObject)UnityEngine.Object.Instantiate(gameObject3);
                 gameObject4.name = gameObject3.name;
                 gameObject4.transform.parent = this.mWinBg;
                 gameObject4.transform.localPosition = new Vector3(20f, -54f, 0f);
                 gameObject4.transform.localScale = Vector3.one;
                 this.mGUIRewardLuckyDrawInfo = gameObject4.AddComponent<GUIRewardLuckyDrawInfo>();
                 this.mGUIRewardLuckyDrawInfo.InitWithBaseScene(GUIRewardCheckBtn.mCurrent);
                 ActivitySubSystem expr_36E = Globals.Instance.Player.ActivitySystem;
                 expr_36E.BuyActivityShopItemEvent = (ActivitySubSystem.ASICallBack)Delegate.Combine(expr_36E.BuyActivityShopItemEvent, new ActivitySubSystem.ASICallBack(this.mGUIRewardLuckyDrawInfo.OnBuyActivityShopItemEvent));
                 Globals.Instance.CliSession.Register(225, new ClientSession.MsgHandler(this.mGUIRewardLuckyDrawInfo.OnMsgRoll));
                 Globals.Instance.CliSession.Register(705, new ClientSession.MsgHandler(this.mGUIRewardLuckyDrawInfo.OnMsgGetLuckyDrawData));
                 Globals.Instance.CliSession.Register(726, new ClientSession.MsgHandler(this.mGUIRewardLuckyDrawInfo.OnMsgUpdateLuckyDrawRankList));
                 GUIRewardCheckBtn.mCurrent.ActivateObj = this.mGUIRewardLuckyDrawInfo.gameObject;
             }
             this.mGUIRewardLuckyDrawInfo.Refresh();
             break;
         case EActivityType.EAT_FlashSale:
             if (this.mGUIRewardFlashSaleInfo == null)
             {
                 GameObject gameObject5 = Res.LoadGUI("GUI/GUIActivityFlashSale");
                 if (gameObject5 == null)
                 {
                     global::Debug.LogError(new object[]
                     {
                         "Res.Load GUI/GUIActivityFlashSale error"
                     });
                     return;
                 }
                 GameObject gameObject6 = (GameObject)UnityEngine.Object.Instantiate(gameObject5);
                 gameObject6.name = gameObject5.name;
                 gameObject6.transform.parent = this.mWinBg;
                 gameObject6.transform.localPosition = new Vector3(103f, -47f, 0f);
                 gameObject6.transform.localScale = Vector3.one;
                 this.mGUIRewardFlashSaleInfo = gameObject6.AddComponent<GUIRewardFlashSaleInfo>();
                 this.mGUIRewardFlashSaleInfo.InitWithBaseScene(GUIRewardCheckBtn.mCurrent);
                 Globals.Instance.CliSession.Register(713, new ClientSession.MsgHandler(this.mGUIRewardFlashSaleInfo.OnMsgGetFlashSaleData));
                 Globals.Instance.CliSession.Register(715, new ClientSession.MsgHandler(this.mGUIRewardFlashSaleInfo.OnMsgStartFlashSale));
                 GUIRewardCheckBtn.mCurrent.ActivateObj = this.mGUIRewardFlashSaleInfo.gameObject;
             }
             this.mGUIRewardFlashSaleInfo.Refresh();
             break;
         case EActivityType.EAT_ScratchOff:
             if (this.mGUIRewardScratchOffInfo == null)
             {
                 GameObject gameObject7 = Res.LoadGUI("GUI/GUIActivityScratchOff");
                 if (gameObject7 == null)
                 {
                     global::Debug.LogError(new object[]
                     {
                         "Res.Load GUI/GUIActivityScratchOff error"
                     });
                     return;
                 }
                 GameObject gameObject8 = (GameObject)UnityEngine.Object.Instantiate(gameObject7);
                 gameObject8.name = gameObject7.name;
                 gameObject8.transform.parent = this.mWinBg;
                 gameObject8.transform.localPosition = new Vector3(103f, -28f, 0f);
                 gameObject8.transform.localScale = Vector3.one;
                 this.mGUIRewardScratchOffInfo = gameObject8.AddComponent<GUIRewardScratchOffInfo>();
                 this.mGUIRewardScratchOffInfo.InitWithBaseScene(this, GUIRewardCheckBtn.mCurrent);
                 Globals.Instance.CliSession.Register(709, new ClientSession.MsgHandler(this.mGUIRewardScratchOffInfo.OnMsgGetScratchOffData));
                 Globals.Instance.CliSession.Register(711, new ClientSession.MsgHandler(this.mGUIRewardScratchOffInfo.OnMsgStartScratchOff));
                 GUIRewardCheckBtn.mCurrent.ActivateObj = this.mGUIRewardScratchOffInfo.gameObject;
             }
             this.mGUIRewardScratchOffInfo.Refresh();
             break;
         case EActivityType.EAT_LevelRank:
         case EActivityType.EAT_VipLevel:
         case EActivityType.EAT_GuildRank:
             if (this.mGUICommonRewardInfo == null)
             {
                 GameObject gameObject9 = Res.LoadGUI("GUI/GUICommonRewardInfo");
                 if (gameObject9 == null)
                 {
                     global::Debug.LogError(new object[]
                     {
                         "Res.Load GUI/GUICommonRewardInfo error"
                     });
                     return;
                 }
                 GameObject gameObject10 = (GameObject)UnityEngine.Object.Instantiate(gameObject9);
                 gameObject10.name = gameObject9.name;
                 gameObject10.transform.parent = this.mWinBg;
                 gameObject10.transform.localPosition = new Vector3(103f, 194f, 0f);
                 gameObject10.transform.localScale = Vector3.one;
                 this.mGUICommonRewardInfo = gameObject10.AddComponent<GUICommonRewardInfo>();
                 this.mGUICommonRewardInfo.InitWithBaseScene(this);
                 ActivitySubSystem expr_750 = Globals.Instance.Player.ActivitySystem;
                 expr_750.GetActivityDescEvent = (ActivitySubSystem.VoidCallback)Delegate.Combine(expr_750.GetActivityDescEvent, new ActivitySubSystem.VoidCallback(this.mGUICommonRewardInfo.OnGetActivityDescEvent));
             }
             GUIRewardCheckBtn.mCurrent.ActivateObj = this.mGUICommonRewardInfo.gameObject;
             this.mGUICommonRewardInfo.Refresh(GUIRewardCheckBtn.mCurrent);
             this.mGUICommonRewardInfo.gameObject.SetActive(true);
             break;
         case EActivityType.EAT_RollEquip:
             if (this.mGUIRewardTreeInfo == null)
             {
                 GameObject gameObject11 = Res.LoadGUI("GUI/GUIActivityTree");
                 if (gameObject11 == null)
                 {
                     global::Debug.LogError(new object[]
                     {
                         "Res.Load GUI/GUIActivityTree error"
                     });
                     return;
                 }
                 GameObject gameObject12 = (GameObject)UnityEngine.Object.Instantiate(gameObject11);
                 gameObject12.name = gameObject11.name;
                 gameObject12.transform.parent = this.mWinBg;
                 gameObject12.transform.localPosition = new Vector3(102f, -28f, 0f);
                 gameObject12.transform.localScale = Vector3.one;
                 this.mGUIRewardTreeInfo = gameObject12.GetComponent<GUIRewardTreeInfo>();
                 this.mGUIRewardTreeInfo.InitWithBaseScene(this, GUIRewardCheckBtn.mCurrent);
                 Globals.Instance.CliSession.Register(765, new ClientSession.MsgHandler(this.mGUIRewardTreeInfo.OnMsgRollEquip));
                 ActivitySubSystem expr_640 = Globals.Instance.Player.ActivitySystem;
                 expr_640.ActivityRollEquipEvent = (ActivitySubSystem.VoidCallback)Delegate.Combine(expr_640.ActivityRollEquipEvent, new ActivitySubSystem.VoidCallback(this.mGUIRewardTreeInfo.RefreshContent));
                 GUIRewardCheckBtn.mCurrent.ActivateObj = this.mGUIRewardTreeInfo.gameObject;
             }
             this.mGUIRewardTreeInfo.Refresh();
             break;
         }
     }
 }