Beispiel #1
0
        public static void PushAward(TrophyParam trophy)
        {
            if (trophy == null || !Object.op_Inequality((Object)NotifyList.mInstance, (Object)null) || !Object.op_Inequality((Object)NotifyList.mInstance.Item_Award, (Object)null))
            {
                return;
            }
            for (int index = 0; index < trophy.Items.Length; ++index)
            {
                AwardParam awardParam = MonoSingleton <GameManager> .Instance.GetAwardParam(trophy.Items[index].iname);

                if (awardParam != null)
                {
                    NotifyListItem notifyListItem = (NotifyListItem)Object.Instantiate <NotifyListItem>((M0)NotifyList.mInstance.Item_Award);
                    notifyListItem.Message.set_text(LocalizedText.Get("sys.AWARD_GET", new object[1]
                    {
                        (object)awardParam.name
                    }));
                    NotifyList.mInstance.Push(notifyListItem);
                }
                else
                {
                    DebugUtility.LogError("Not found trophy award. iname is [ " + trophy.Items[index].iname + " ]");
                }
            }
        }
Beispiel #2
0
        private void SetUp()
        {
            string str = string.Empty;

            if (this.Type == AwardItem.PlayerType.Player)
            {
                PlayerData dataOfClass = DataSource.FindDataOfClass <PlayerData>(((Component)this).get_gameObject(), (PlayerData)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.SelectedAward;
                }
            }
            else if (this.Type == AwardItem.PlayerType.Friend)
            {
                FriendData dataOfClass = DataSource.FindDataOfClass <FriendData>(((Component)this).get_gameObject(), (FriendData)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.SelectAward;
                }
            }
            else if (this.Type == AwardItem.PlayerType.ArenaPlayer)
            {
                ArenaPlayer dataOfClass = DataSource.FindDataOfClass <ArenaPlayer>(((Component)this).get_gameObject(), (ArenaPlayer)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.SelectAward;
                }
            }
            else if (this.Type == AwardItem.PlayerType.MultiPlayer)
            {
                JSON_MyPhotonPlayerParam dataOfClass = DataSource.FindDataOfClass <JSON_MyPhotonPlayerParam>(((Component)this).get_gameObject(), (JSON_MyPhotonPlayerParam)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.award;
                }
            }
            else if (this.Type == AwardItem.PlayerType.ChatPlayer)
            {
                ChatPlayerData dataOfClass = DataSource.FindDataOfClass <ChatPlayerData>(((Component)this).get_gameObject(), (ChatPlayerData)null);
                if (dataOfClass != null)
                {
                    str = dataOfClass.award;
                }
            }
            this.mSelectedAward = str;
            if (!string.IsNullOrEmpty(this.mSelectedAward))
            {
                AwardParam awardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAwardParam(this.mSelectedAward);

                if (awardParam != null)
                {
                    this.mAwardParam = awardParam;
                }
            }
            else
            {
                this.mAwardParam = (AwardParam)null;
            }
            this.IsDone = true;
        }
Beispiel #3
0
        private RewardData GiftDataToRewardData(GiftData[] giftDatas)
        {
            RewardData rewardData = new RewardData();

            rewardData.Exp        = 0;
            rewardData.Stamina    = 0;
            rewardData.MultiCoin  = 0;
            rewardData.KakeraCoin = 0;
            for (int index = 0; index < giftDatas.Length; ++index)
            {
                GiftData giftData = giftDatas[index];
                rewardData.Coin       += giftData.coin;
                rewardData.Gold       += giftData.gold;
                rewardData.ArenaMedal += giftData.arenacoin;
                rewardData.MultiCoin  += giftData.multicoin;
                rewardData.KakeraCoin += giftData.kakeracoin;
                if (giftData.CheckGiftTypeIncluded(GiftTypes.ConceptCard))
                {
                    ConceptCardParam conceptCardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(giftData.ConceptCardIname);

                    rewardData.AddReward(conceptCardParam, giftData.ConceptCardNum);
                    if (giftData.IsGetConceptCardUnit)
                    {
                        ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(giftData.ConceptCardGetUnitIname);

                        rewardData.AddReward(itemParam, 1);
                    }
                }
                if (giftData.iname != null)
                {
                    if (giftData.CheckGiftTypeIncluded(GiftTypes.Artifact))
                    {
                        ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(giftData.iname);

                        rewardData.AddReward(artifactParam, giftData.num);
                    }
                    else if (giftData.CheckGiftTypeIncluded(GiftTypes.Award))
                    {
                        AwardParam awardParam = MonoSingleton <GameManager> .Instance.GetAwardParam(giftData.iname);

                        rewardData.AddReward(awardParam.ToItemParam(), giftData.num);
                    }
                    else
                    {
                        ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(giftData.iname);

                        rewardData.AddReward(itemParam, giftData.num);
                    }
                }
            }
            return(rewardData);
        }
Beispiel #4
0
 private void RefreshAwardDatas()
 {
     this.mAwardDatas.Clear();
     AwardParam[] allAwards = this.gm.MasterParam.GetAllAwards();
     if (allAwards == null || allAwards.Length <= 0)
     {
         DebugUtility.LogWarning("AwardList.cs => RefreshAwardDatas():awards is Null or Count 0.");
     }
     else
     {
         foreach (int num in Enum.GetValues(typeof(AwardParam.Tab)))
         {
             AwardParam.Tab key = (AwardParam.Tab)num;
             if (!this.mAwardDatas.ContainsKey(key))
             {
                 this.mAwardDatas.Add(key, new List <AwardParam>());
             }
         }
         for (int index = 0; index < allAwards.Length; ++index)
         {
             AwardParam awardParam = allAwards[index];
             if (allAwards != null)
             {
                 AwardParam.Tab tab = (AwardParam.Tab)awardParam.tab;
                 if (!this.mAwardDatas.ContainsKey(tab))
                 {
                     this.mAwardDatas.Add(tab, new List <AwardParam>());
                 }
                 if (tab == AwardParam.Tab.Extra)
                 {
                     if (this.mOpenAwards != null && this.mOpenAwards.Contains(awardParam.iname))
                     {
                         this.mAwardDatas[tab].Add(awardParam);
                     }
                 }
                 else
                 {
                     this.mAwardDatas[tab].Add(awardParam);
                 }
             }
         }
         this.mAwardDatas[AwardParam.Tab.Normal].Insert(0, this.CreateRemoveAwardData());
         if (this.mAwardDatas[AwardParam.Tab.Extra].Count <= 0)
         {
             return;
         }
         this.mAwardDatas[AwardParam.Tab.Extra].Insert(0, this.CreateRemoveAwardData());
     }
 }
Beispiel #5
0
        private void Refresh()
        {
            string key = FlowNode_Variable.Get("CONFIRM_SELECT_AWARD");

            if (string.IsNullOrEmpty(key))
            {
                DebugUtility.LogError("AwardSelectConfirmWindow:select_iname is Null or Empty");
            }
            else
            {
                AwardParam awardParam = this.gm.MasterParam.GetAwardParam(key);
                if (awardParam == null)
                {
                    return;
                }
                if (Object.op_Inequality((Object)this.AwardImg, (Object)null) && Object.op_Inequality((Object)this.mImageArray, (Object)null))
                {
                    if (this.mImageArray.Images.Length <= awardParam.grade)
                    {
                        this.SetExtraAwardImage(awardParam.bg);
                        awardParam.name = string.Empty;
                    }
                    else
                    {
                        this.mImageArray.ImageIndex = awardParam.grade;
                    }
                }
                if (Object.op_Inequality((Object)this.AwardName, (Object)null))
                {
                    this.AwardName.set_text(awardParam.name);
                }
                if (!Object.op_Inequality((Object)this.ExpText, (Object)null))
                {
                    return;
                }
                this.ExpText.set_text(awardParam.expr);
            }
        }
        private void SetRewardName(int idx, MultiTowerFloorParam param)
        {
            GameManager          instance             = MonoSingleton <GameManager> .Instance;
            MultiTowerRewardItem multiTowerRewardItem = instance.GetMTFloorReward(param.reward_id, this.mRound)[idx];
            int    num      = multiTowerRewardItem.num;
            string itemname = multiTowerRewardItem.itemname;

            MultiTowerRewardItem.RewardType type = multiTowerRewardItem.type;
            string str1 = LocalizedText.Get("sys.MULTI_TOWER_REWARD_GET_MSG");

            if (!Object.op_Inequality((Object)this.rewardTxt, (Object)null))
            {
                return;
            }
            string str2 = string.Empty;

            switch (type)
            {
            case MultiTowerRewardItem.RewardType.Item:
                ItemParam itemParam = instance.GetItemParam(itemname);
                if (itemParam != null)
                {
                    str2 = itemParam.name + string.Format(LocalizedText.Get("sys.CROSS_NUM"), (object)num);
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Coin:
                str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)num);
                break;

            case MultiTowerRewardItem.RewardType.Artifact:
                ArtifactParam artifactParam = instance.MasterParam.GetArtifactParam(itemname);
                if (artifactParam != null)
                {
                    str2 = artifactParam.name;
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Award:
                AwardParam awardParam = instance.GetAwardParam(itemname);
                if (awardParam != null)
                {
                    str2 = awardParam.name;
                }
                str1 = LocalizedText.Get("sys.MULTI_TOWER_REWARD_GET_MSG");
                break;

            case MultiTowerRewardItem.RewardType.Unit:
                UnitParam unitParam = instance.GetUnitParam(itemname);
                if (unitParam != null)
                {
                    str2 = unitParam.name;
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Gold:
                str2 = num.ToString() + LocalizedText.Get("sys.GOLD");
                break;
            }
            this.rewardTxt.set_text(string.Format(LocalizedText.Get("sys.MULTI_TOWER_REWARD_NAME"), (object)str2));
            if (!Object.op_Inequality((Object)this.getTxt, (Object)null))
            {
                return;
            }
            this.getTxt.set_text(str1);
        }
Beispiel #7
0
        private void Refresh()
        {
            if (this.mAwardItems == null || this.mAwardItems.Count <= 0 || (this.mAwards == null || this.mAwards.Length <= 0))
            {
                return;
            }
            using (List <GameObject> .Enumerator enumerator = this.mAwardItems.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    enumerator.Current.SetActive(false);
                }
            }
            int length = this.mAwards.Length;
            int num1   = this.mMaxViewItems * this.mCurrentPage;
            int num2   = num1 >= length ? 0 : num1;
            int num3   = this.mMaxViewItems * (this.mCurrentPage + 1);
            int num4   = num3 >= length ? length : num3;
            int index1 = num2;

            for (int index2 = 0; index2 < this.mAwardItems.Count; ++index2)
            {
                AwardParam awardParam = index1 >= this.mAwards.Length ? (AwardParam)null : this.mAwards[index1];
                if (awardParam != null)
                {
                    GameObject mAwardItem = this.mAwardItems[index2];
                    if (Object.op_Inequality((Object)mAwardItem, (Object)null))
                    {
                        AwardListItem component1 = (AwardListItem)mAwardItem.GetComponent <AwardListItem>();
                        if (Object.op_Inequality((Object)component1, (Object)null))
                        {
                            mAwardItem.SetActive(true);
                            mAwardItem.SetActive(true);
                            bool hasItem = this.mOpenAwards != null && this.mOpenAwards.Contains(awardParam.iname);
                            component1.SetUp(awardParam.iname, hasItem, awardParam.iname == this.gm.Player.SelectedAward, awardParam.grade <= 0);
                            Button component2 = (Button)mAwardItem.GetComponent <SRPG_Button>();
                            if (Object.op_Inequality((Object)component2, (Object)null))
                            {
                                ((UnityEventBase)component2.get_onClick()).RemoveAllListeners();
                                if (awardParam.grade <= 0)
                                {
                                    // ISSUE: object of a compiler-generated type is created
                                    // ISSUE: method pointer
                                    ((UnityEvent)component2.get_onClick()).AddListener(new UnityAction((object)new AwardList.\u003CRefresh\u003Ec__AnonStorey231()
                                    {
                                        \u003C\u003Ef__this = this,
                                        iname = awardParam.iname
                                    }, __methodptr(\u003C\u003Em__23F)));
                                    ((Selectable)component2).set_interactable(true);
                                }
                                else
                                {
                                    if (hasItem)
                                    {
                                        // ISSUE: object of a compiler-generated type is created
                                        // ISSUE: method pointer
                                        ((UnityEvent)component2.get_onClick()).AddListener(new UnityAction((object)new AwardList.\u003CRefresh\u003Ec__AnonStorey232()
                                        {
                                            \u003C\u003Ef__this = this,
                                            iname = awardParam.iname
                                        }, __methodptr(\u003C\u003Em__240)));
                                    }
                                    ((Selectable)component2).set_interactable(hasItem);
                                }
                            }
                        }
                    }
                    if (index1 <= num4)
                    {
                        ++index1;
                    }
                }
            }
            if (Object.op_Inequality((Object)this.Pager, (Object)null))
            {
                this.Pager.set_text(LocalizedText.Get("sys.TEXT_PAGER_TEMP", (object)(this.mCurrentPage + 1).ToString(), (object)this.mMaxPage.ToString()));
            }
            if (!Object.op_Inequality((Object)this.Prev, (Object)null) || !Object.op_Inequality((Object)this.Next, (Object)null))
            {
                return;
            }
            ((Selectable)this.Prev).set_interactable(this.mCurrentPage - 1 >= 0);
            ((Selectable)this.Next).set_interactable(this.mCurrentPage + 1 < this.mMaxPage);
        }
        public void SetData(int idx = 0)
        {
            GameManager          instance    = MonoSingleton <GameManager> .Instance;
            MultiTowerFloorParam dataOfClass = DataSource.FindDataOfClass <MultiTowerFloorParam>(((Component)this).get_gameObject(), (MultiTowerFloorParam)null);
            int floor = (int)dataOfClass.floor;

            if (dataOfClass == null)
            {
                return;
            }
            int mtRound = MonoSingleton <GameManager> .Instance.GetMTRound(GlobalVars.SelectedMultiTowerFloor);

            List <MultiTowerRewardItem> mtFloorReward        = instance.GetMTFloorReward(dataOfClass.reward_id, mtRound);
            MultiTowerRewardItem        multiTowerRewardItem = mtFloorReward[idx];

            MultiTowerRewardItem.RewardType rewardType = MultiTowerRewardItem.RewardType.Item;
            string str = string.Empty;
            int    num = 0;

            if (idx >= 0 && idx < mtFloorReward.Count)
            {
                rewardType = multiTowerRewardItem.type;
                str        = multiTowerRewardItem.itemname;
                num        = multiTowerRewardItem.num;
            }
            if (Object.op_Inequality((Object)this.itemObj, (Object)null))
            {
                this.itemObj.SetActive(true);
            }
            if (Object.op_Inequality((Object)this.amountObj, (Object)null))
            {
                this.amountObj.SetActive(true);
            }
            if (Object.op_Inequality((Object)this.unitObj, (Object)null))
            {
                this.unitObj.SetActive(false);
            }
            switch (rewardType)
            {
            case MultiTowerRewardItem.RewardType.Item:
                if (Object.op_Inequality((Object)this.itemObj, (Object)null) && Object.op_Inequality((Object)this.amountObj, (Object)null))
                {
                    ArtifactIcon componentInChildren = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>();
                    if (Object.op_Inequality((Object)componentInChildren, (Object)null))
                    {
                        ((Behaviour)componentInChildren).set_enabled(false);
                    }
                    this.itemObj.SetActive(true);
                    DataSource component1 = (DataSource)this.itemObj.GetComponent <DataSource>();
                    if (Object.op_Inequality((Object)component1, (Object)null))
                    {
                        component1.Clear();
                    }
                    DataSource component2 = (DataSource)this.amountObj.GetComponent <DataSource>();
                    if (Object.op_Inequality((Object)component2, (Object)null))
                    {
                        component2.Clear();
                    }
                    ItemParam itemParam = instance.GetItemParam(str);
                    DataSource.Bind <ItemParam>(this.itemObj, itemParam);
                    ItemData data = new ItemData();
                    data.Setup(0L, itemParam, num);
                    DataSource.Bind <ItemData>(this.amountObj, data);
                    Transform child = this.itemObj.get_transform().FindChild("icon");
                    if (Object.op_Inequality((Object)child, (Object)null))
                    {
                        GameParameter component3 = (GameParameter)((Component)child).GetComponent <GameParameter>();
                        if (Object.op_Inequality((Object)component3, (Object)null))
                        {
                            ((Behaviour)component3).set_enabled(true);
                        }
                    }
                    GameParameter.UpdateAll(this.itemObj);
                    if (Object.op_Inequality((Object)this.iconParam, (Object)null))
                    {
                        this.iconParam.UpdateValue();
                    }
                    if (Object.op_Inequality((Object)this.frameParam, (Object)null))
                    {
                        this.frameParam.UpdateValue();
                    }
                    if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                    {
                        this.rewardName.set_text(itemParam.name + string.Format(LocalizedText.Get("sys.CROSS_NUM"), (object)num));
                        break;
                    }
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Coin:
                if (Object.op_Inequality((Object)this.itemTex, (Object)null))
                {
                    GameParameter component = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        ((Behaviour)component).set_enabled(false);
                    }
                    this.itemTex.set_texture(this.coinTex);
                }
                if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.coinBase, (Object)null))
                {
                    this.frameTex.set_sprite(this.coinBase);
                }
                if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                {
                    this.rewardName.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)num));
                }
                if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                {
                    this.amountObj.SetActive(false);
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Artifact:
                if (Object.op_Inequality((Object)this.itemObj, (Object)null))
                {
                    DataSource component = (DataSource)this.itemObj.GetComponent <DataSource>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        component.Clear();
                    }
                    ArtifactParam artifactParam = instance.MasterParam.GetArtifactParam(str);
                    DataSource.Bind <ArtifactParam>(this.itemObj, artifactParam);
                    ArtifactIcon componentInChildren = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>();
                    if (Object.op_Inequality((Object)componentInChildren, (Object)null))
                    {
                        ((Behaviour)componentInChildren).set_enabled(true);
                        componentInChildren.UpdateValue();
                        if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                        {
                            this.rewardName.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_ARTIFACT"), (object)artifactParam.name));
                        }
                        if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                        {
                            this.amountObj.SetActive(false);
                            break;
                        }
                        break;
                    }
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Award:
                if (Object.op_Inequality((Object)this.itemObj, (Object)null) && Object.op_Inequality((Object)this.amountObj, (Object)null))
                {
                    ArtifactIcon componentInChildren = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>();
                    if (Object.op_Inequality((Object)componentInChildren, (Object)null))
                    {
                        ((Behaviour)componentInChildren).set_enabled(false);
                    }
                    this.itemObj.SetActive(true);
                    AwardParam awardParam = instance.GetAwardParam(str);
                    Transform  child      = this.itemObj.get_transform().FindChild("icon");
                    if (Object.op_Inequality((Object)child, (Object)null))
                    {
                        IconLoader iconLoader = GameUtility.RequireComponent <IconLoader>(((Component)child).get_gameObject());
                        if (!string.IsNullOrEmpty(awardParam.icon))
                        {
                            iconLoader.ResourcePath = AssetPath.ItemIcon(awardParam.icon);
                        }
                        GameParameter component = (GameParameter)((Component)child).GetComponent <GameParameter>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            ((Behaviour)component).set_enabled(false);
                        }
                    }
                    if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.coinBase, (Object)null))
                    {
                        this.frameTex.set_sprite(this.coinBase);
                    }
                    if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                    {
                        this.amountObj.SetActive(false);
                        break;
                    }
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Unit:
                if (Object.op_Inequality((Object)this.unitObj, (Object)null))
                {
                    if (Object.op_Inequality((Object)this.itemObj, (Object)null))
                    {
                        this.itemObj.SetActive(false);
                    }
                    this.unitObj.SetActive(true);
                    UnitParam unitParam = instance.GetUnitParam(str);
                    DebugUtility.Assert(unitParam != null, "Invalid unit:" + str);
                    UnitData data = new UnitData();
                    data.Setup(str, 0, 1, 0, (string)null, 1, EElement.None, 0);
                    DataSource.Bind <UnitData>(this.unitObj, data);
                    GameParameter.UpdateAll(this.unitObj);
                    if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                    {
                        this.rewardName.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_UNIT"), (object)unitParam.name));
                        break;
                    }
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Gold:
                if (Object.op_Inequality((Object)this.itemTex, (Object)null))
                {
                    GameParameter component = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        ((Behaviour)component).set_enabled(false);
                    }
                    this.itemTex.set_texture(this.goldTex);
                }
                if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.goldBase, (Object)null))
                {
                    this.frameTex.set_sprite(this.goldBase);
                }
                if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                {
                    this.rewardName.set_text(num.ToString() + LocalizedText.Get("sys.GOLD"));
                }
                if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                {
                    this.amountObj.SetActive(false);
                    break;
                }
                break;
            }
            this.mIdx = idx;
            if (Object.op_Inequality((Object)this.currentMark, (Object)null))
            {
                this.currentMark.SetActive((int)dataOfClass.floor == floor);
            }
            if (Object.op_Inequality((Object)this.current_fil, (Object)null))
            {
                this.current_fil.SetActive((int)dataOfClass.floor == floor);
            }
            if (Object.op_Inequality((Object)this.clearMark, (Object)null))
            {
                this.clearMark.SetActive((int)dataOfClass.floor - 1 < floor);
            }
            if (!Object.op_Inequality((Object)this.cleared_fil, (Object)null))
            {
                return;
            }
            this.cleared_fil.SetActive((int)dataOfClass.floor - 1 < floor);
        }
        public void OnDetailClick()
        {
            GameManager          instance    = MonoSingleton <GameManager> .Instance;
            MultiTowerFloorParam dataOfClass = DataSource.FindDataOfClass <MultiTowerFloorParam>(((Component)this).get_gameObject(), (MultiTowerFloorParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            int mtRound = MonoSingleton <GameManager> .Instance.GetMTRound(GlobalVars.SelectedMultiTowerFloor);

            List <MultiTowerRewardItem> mtFloorReward        = instance.GetMTFloorReward(dataOfClass.reward_id, mtRound);
            MultiTowerRewardItem        multiTowerRewardItem = mtFloorReward[this.mIdx];

            MultiTowerRewardItem.RewardType rewardType = MultiTowerRewardItem.RewardType.Item;
            string key = string.Empty;
            int    num = 0;

            if (this.mIdx >= 0 && this.mIdx < mtFloorReward.Count)
            {
                rewardType = multiTowerRewardItem.type;
                key        = multiTowerRewardItem.itemname;
                num        = multiTowerRewardItem.num;
            }
            string str1 = string.Empty;
            string str2 = string.Empty;

            switch (rewardType)
            {
            case MultiTowerRewardItem.RewardType.Item:
                ItemParam itemParam = instance.GetItemParam(key);
                if (itemParam != null)
                {
                    str1 = itemParam.name;
                    str2 = itemParam.Expr;
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Coin:
                str1 = LocalizedText.Get("sys.COIN");
                str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)num);
                break;

            case MultiTowerRewardItem.RewardType.Artifact:
                ArtifactParam artifactParam = instance.MasterParam.GetArtifactParam(key);
                if (artifactParam != null)
                {
                    str1 = string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_ARTIFACT"), (object)artifactParam.name);
                    str2 = artifactParam.Expr;
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Award:
                AwardParam awardParam = instance.GetAwardParam(key);
                if (awardParam != null)
                {
                    str1 = awardParam.name;
                    str2 = awardParam.expr;
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Unit:
                str1 = string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_UNIT"), (object)instance.GetUnitParam(key).name);
                break;

            case MultiTowerRewardItem.RewardType.Gold:
                str1 = LocalizedText.Get("sys.GOLD");
                str2 = num.ToString() + LocalizedText.Get("sys.GOLD");
                break;
            }
            if (Object.op_Inequality((Object)this.rewardDetailName, (Object)null))
            {
                this.rewardDetailName.set_text(str1);
            }
            if (Object.op_Inequality((Object)this.rewardDetailInfo, (Object)null))
            {
                this.rewardDetailInfo.set_text(str2);
            }
            if (Object.op_Inequality((Object)this.pos, (Object)null))
            {
                ((Transform)this.pos).set_position(((Component)this).get_gameObject().get_transform().get_position());
            }
            FlowNode_TriggerLocalEvent.TriggerLocalEvent((Component)this, "OPEN_DETAIL");
        }
Beispiel #10
0
        public void Initialize(RankMatchMissionWindow window)
        {
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RewardUnit, (UnityEngine.Object)null))
            {
                this.RewardUnit.SetActive(false);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RewardItem, (UnityEngine.Object)null))
            {
                this.RewardItem.SetActive(false);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RewardCard, (UnityEngine.Object)null))
            {
                this.RewardCard.SetActive(false);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RewardArtifact, (UnityEngine.Object)null))
            {
                this.RewardArtifact.SetActive(false);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RewardAward, (UnityEngine.Object)null))
            {
                this.RewardAward.SetActive(false);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RewardGold, (UnityEngine.Object)null))
            {
                this.RewardGold.SetActive(false);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RewardCoin, (UnityEngine.Object)null))
            {
                this.RewardCoin.SetActive(false);
            }
            this.mWindow = window;
            VersusRankMissionParam dataOfClass1 = DataSource.FindDataOfClass <VersusRankMissionParam>(((Component)this).get_gameObject(), (VersusRankMissionParam)null);
            int num = 0;

            ReqRankMatchMission.MissionProgress dataOfClass2 = DataSource.FindDataOfClass <ReqRankMatchMission.MissionProgress>(((Component)this).get_gameObject(), (ReqRankMatchMission.MissionProgress)null);
            if (dataOfClass2 != null)
            {
                num = dataOfClass2.prog;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Completed, (UnityEngine.Object)null))
            {
                this.Completed.SetActive(dataOfClass1.IVal <= num);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.GetRewardButton, (UnityEngine.Object)null))
            {
                ((Selectable)this.GetRewardButton).set_interactable(dataOfClass1.IVal <= num && string.IsNullOrEmpty(dataOfClass2.rewarded_at));
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Count, (UnityEngine.Object)null))
            {
                this.Count.SetActive(dataOfClass1.IVal > num);
            }
            GameManager gm = MonoSingleton <GameManager> .Instance;

            gm.GetVersusRankClassRewardList(dataOfClass1.RewardId).ForEach((Action <VersusRankReward>)(reward =>
            {
                bool flag = false;
                GameObject gameObject;
                switch (reward.Type)
                {
                case RewardType.Item:
                    ItemParam itemParam = gm.GetItemParam(reward.IName);
                    if (itemParam == null)
                    {
                        return;
                    }
                    gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.RewardItem);
                    DataSource.Bind <ItemParam>(gameObject, itemParam);
                    flag = true;
                    break;

                case RewardType.Gold:
                    gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.RewardGold);
                    flag       = true;
                    break;

                case RewardType.Coin:
                    gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.RewardCoin);
                    flag       = true;
                    break;

                case RewardType.Artifact:
                    ArtifactParam artifactParam = gm.MasterParam.GetArtifactParam(reward.IName);
                    if (artifactParam == null)
                    {
                        return;
                    }
                    gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.RewardArtifact);
                    DataSource.Bind <ArtifactParam>(gameObject, artifactParam);
                    break;

                case RewardType.Unit:
                    UnitParam unitParam = gm.GetUnitParam(reward.IName);
                    if (unitParam == null)
                    {
                        return;
                    }
                    gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.RewardUnit);
                    DataSource.Bind <UnitParam>(gameObject, unitParam);
                    break;

                case RewardType.Award:
                    AwardParam awardParam = gm.GetAwardParam(reward.IName);
                    if (awardParam == null)
                    {
                        return;
                    }
                    gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.RewardAward);
                    DataSource.Bind <AwardParam>(gameObject, awardParam);
                    break;

                default:
                    return;
                }
                if (flag)
                {
                    Transform child = gameObject.get_transform().FindChild("amount/Text_amount");
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child, (UnityEngine.Object)null))
                    {
                        Text component = (Text)((Component)child).GetComponent <Text>();
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                        {
                            component.set_text(reward.Num.ToString());
                        }
                    }
                }
                gameObject.get_transform().SetParent(this.RewardList, false);
                gameObject.SetActive(true);
            }));
        }
        protected override void Start()
        {
            base.Start();
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ListItem, (UnityEngine.Object)null))
            {
                return;
            }
            ((Component)this.ListItem).get_gameObject().SetActive(false);
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ListItem.RewardUnit, (UnityEngine.Object)null))
            {
                return;
            }
            this.ListItem.RewardUnit.SetActive(false);
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ListItem.RewardItem, (UnityEngine.Object)null))
            {
                return;
            }
            this.ListItem.RewardItem.SetActive(false);
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ListItem.RewardCard, (UnityEngine.Object)null))
            {
                return;
            }
            this.ListItem.RewardCard.SetActive(false);
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ListItem.RewardArtifact, (UnityEngine.Object)null))
            {
                return;
            }
            this.ListItem.RewardArtifact.SetActive(false);
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ListItem.RewardAward, (UnityEngine.Object)null))
            {
                return;
            }
            this.ListItem.RewardAward.SetActive(false);
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ListItem.RewardGold, (UnityEngine.Object)null))
            {
                return;
            }
            this.ListItem.RewardGold.SetActive(false);
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ListItem.RewardCoin, (UnityEngine.Object)null))
            {
                return;
            }
            this.ListItem.RewardCoin.SetActive(false);
            GameManager gm = MonoSingleton <GameManager> .Instance;

            gm.GetVersusRankClassList(gm.RankMatchScheduleId).ForEach((Action <VersusRankClassParam>)(vrc =>
            {
                RankMatchClassListItem item = (RankMatchClassListItem)UnityEngine.Object.Instantiate <RankMatchClassListItem>((M0)this.ListItem);
                DataSource.Bind <VersusRankClassParam>(((Component)item).get_gameObject(), vrc);
                this.AddItem((ListItemEvents)item);
                ((Component)item).get_transform().SetParent(((Component)this).get_transform(), false);
                ((Component)item).get_gameObject().SetActive(true);
                gm.GetVersusRankClassRewardList(vrc.RewardId).ForEach((Action <VersusRankReward>)(reward =>
                {
                    bool flag = false;
                    GameObject gameObject;
                    switch (reward.Type)
                    {
                    case RewardType.Item:
                        ItemParam itemParam = gm.GetItemParam(reward.IName);
                        if (itemParam == null)
                        {
                            return;
                        }
                        gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)item.RewardItem);
                        DataSource.Bind <ItemParam>(gameObject, itemParam);
                        flag = true;
                        break;

                    case RewardType.Gold:
                        gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)item.RewardGold);
                        flag       = true;
                        break;

                    case RewardType.Coin:
                        gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)item.RewardCoin);
                        flag       = true;
                        break;

                    case RewardType.Artifact:
                        ArtifactParam artifactParam = gm.MasterParam.GetArtifactParam(reward.IName);
                        if (artifactParam == null)
                        {
                            return;
                        }
                        gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)item.RewardArtifact);
                        DataSource.Bind <ArtifactParam>(gameObject, artifactParam);
                        break;

                    case RewardType.Unit:
                        UnitParam unitParam = gm.GetUnitParam(reward.IName);
                        if (unitParam == null)
                        {
                            return;
                        }
                        gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)item.RewardUnit);
                        DataSource.Bind <UnitParam>(gameObject, unitParam);
                        break;

                    case RewardType.Award:
                        AwardParam awardParam = gm.GetAwardParam(reward.IName);
                        if (awardParam == null)
                        {
                            return;
                        }
                        gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)item.RewardAward);
                        DataSource.Bind <AwardParam>(gameObject, awardParam);
                        break;

                    default:
                        return;
                    }
                    if (flag)
                    {
                        Transform child = gameObject.get_transform().FindChild("amount/Text_amount");
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child, (UnityEngine.Object)null))
                        {
                            Text component = (Text)((Component)child).GetComponent <Text>();
                            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                            {
                                component.set_text(reward.Num.ToString());
                            }
                        }
                    }
                    gameObject.get_transform().SetParent(item.RewardList, false);
                    gameObject.SetActive(true);
                }));
            }));
        }
Beispiel #12
0
        private void UpdateItems()
        {
            if (Object.op_Equality((Object)this.ItemTemplate, (Object)null) || this.mMailListItems == null)
            {
                return;
            }
            List <MailData> currentMails = MonoSingleton <GameManager> .Instance.Player.CurrentMails;

            if (this.mMailListItems.Count < currentMails.Count)
            {
                Transform transform = ((Component)this).get_transform();
                int       num       = currentMails.Count - this.mMailListItems.Count;
                for (int index = 0; index < num; ++index)
                {
                    GameObject listItem = this.CreateListItem();
                    listItem.get_transform().SetParent(transform, false);
                    this.mMailListItems.Add(listItem);
                }
            }
            for (int index1 = 0; index1 < this.mMailListItems.Count; ++index1)
            {
                GameObject mMailListItem = this.mMailListItems[index1];
                if (index1 >= currentMails.Count)
                {
                    mMailListItem.SetActive(false);
                }
                else
                {
                    mMailListItem.SetActive(true);
                    MailData data1 = currentMails[index1];
                    DataSource.Bind <MailData>(mMailListItem, data1);
                    DataSource.Bind <MailData>(((MailListItem)mMailListItem.GetComponent <MailListItem>()).Button, data1);
                    int num = 0;
                    for (int index2 = 0; index2 < data1.gifts.Length; ++index2)
                    {
                        GiftData gift = data1.gifts[index2];
                        if (gift.CheckGiftTypeIncluded(GiftTypes.Item))
                        {
                            ++num;
                        }
                        if (gift.CheckGiftTypeIncluded(GiftTypes.Unit))
                        {
                            ++num;
                        }
                        if (gift.CheckGiftTypeIncluded(GiftTypes.Coin))
                        {
                            ++num;
                        }
                        if (gift.CheckGiftTypeIncluded(GiftTypes.Gold))
                        {
                            ++num;
                        }
                        if (gift.CheckGiftTypeIncluded(GiftTypes.ArenaCoin))
                        {
                            ++num;
                        }
                        if (gift.CheckGiftTypeIncluded(GiftTypes.MultiCoin))
                        {
                            ++num;
                        }
                        if (gift.CheckGiftTypeIncluded(GiftTypes.KakeraCoin))
                        {
                            ++num;
                        }
                        if (gift.CheckGiftTypeIncluded(GiftTypes.Award))
                        {
                            ++num;
                        }
                        if (num > 1)
                        {
                            break;
                        }
                    }
                    if (num >= 2)
                    {
                        MailIcon component = (MailIcon)mMailListItem.GetComponent <MailIcon>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            if (Object.op_Inequality((Object)component.CurrentIcon, (Object)null))
                            {
                                component.CurrentIcon.SetActive(false);
                            }
                            component.CurrentIcon = component.SetIconTemplate;
                            component.CurrentIcon.SetActive(true);
                        }
                    }
                    else
                    {
                        MailIcon component = (MailIcon)mMailListItem.GetComponent <MailIcon>();
                        for (int index2 = 0; index2 < data1.gifts.Length; ++index2)
                        {
                            GiftData gift = data1.gifts[index2];
                            if (!gift.NotSet)
                            {
                                if (gift.CheckGiftTypeIncluded(GiftTypes.Item | GiftTypes.Unit | GiftTypes.SelectUnitItem | GiftTypes.SelectItem | GiftTypes.SelectArtifactItem))
                                {
                                    ItemData data2 = new ItemData();
                                    data2.Setup(0L, gift.iname, gift.num);
                                    DataSource.Bind <ItemData>(mMailListItem, data2);
                                    if (Object.op_Inequality((Object)component, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component.CurrentIcon, (Object)null))
                                        {
                                            component.CurrentIcon.SetActive(false);
                                        }
                                        component.CurrentIcon = component.ItemIconTemplate;
                                        component.CurrentIcon.SetActive(true);
                                        break;
                                    }
                                    break;
                                }
                                if (gift.CheckGiftTypeIncluded(GiftTypes.Artifact))
                                {
                                    ArtifactData artifactData = this.CreateArtifactData(gift.iname);
                                    if (artifactData != null)
                                    {
                                        DataSource.Bind <ArtifactData>(mMailListItem, artifactData);
                                    }
                                    if (Object.op_Inequality((Object)component, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component.CurrentIcon, (Object)null))
                                        {
                                            component.CurrentIcon.SetActive(false);
                                        }
                                        component.CurrentIcon = component.ArtifactIconTemplate;
                                        component.CurrentIcon.SetActive(true);
                                        break;
                                    }
                                    break;
                                }
                                if (gift.CheckGiftTypeIncluded(GiftTypes.Award))
                                {
                                    AwardParam awardParam = MonoSingleton <GameManager> .Instance.GetAwardParam(gift.iname);

                                    ItemData data2 = new ItemData();
                                    data2.Setup(0L, awardParam.ToItemParam(), gift.num);
                                    DataSource.Bind <ItemData>(mMailListItem, data2);
                                    if (Object.op_Inequality((Object)component, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component.CurrentIcon, (Object)null))
                                        {
                                            component.CurrentIcon.SetActive(false);
                                        }
                                        component.CurrentIcon = component.ItemIconTemplate;
                                        component.CurrentIcon.SetActive(true);
                                        break;
                                    }
                                    break;
                                }
                                if (gift.CheckGiftTypeIncluded(GiftTypes.Coin))
                                {
                                    if (Object.op_Inequality((Object)component, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component.CurrentIcon, (Object)null))
                                        {
                                            component.CurrentIcon.SetActive(false);
                                        }
                                        component.CurrentIcon = component.CoinIconTemplate;
                                        component.CurrentIcon.SetActive(true);
                                        break;
                                    }
                                    break;
                                }
                                if (gift.CheckGiftTypeIncluded(GiftTypes.Gold))
                                {
                                    if (Object.op_Inequality((Object)component, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component.CurrentIcon, (Object)null))
                                        {
                                            component.CurrentIcon.SetActive(false);
                                        }
                                        component.CurrentIcon = component.GoldIconTemplate;
                                        component.CurrentIcon.SetActive(true);
                                        break;
                                    }
                                    break;
                                }
                                if (gift.CheckGiftTypeIncluded(GiftTypes.ArenaCoin))
                                {
                                    if (Object.op_Inequality((Object)component, (Object)null))
                                    {
                                        if (Object.op_Inequality((Object)component.CurrentIcon, (Object)null))
                                        {
                                            component.CurrentIcon.SetActive(false);
                                        }
                                        component.CurrentIcon = component.ArenaCoinIconTemplate;
                                        component.CurrentIcon.SetActive(true);
                                    }
                                }
                                else
                                {
                                    if (gift.CheckGiftTypeIncluded(GiftTypes.MultiCoin))
                                    {
                                        if (Object.op_Inequality((Object)component, (Object)null))
                                        {
                                            if (Object.op_Inequality((Object)component.CurrentIcon, (Object)null))
                                            {
                                                component.CurrentIcon.SetActive(false);
                                            }
                                            component.CurrentIcon = component.MultiCoinIconTemplate;
                                            component.CurrentIcon.SetActive(true);
                                            break;
                                        }
                                        break;
                                    }
                                    if (gift.CheckGiftTypeIncluded(GiftTypes.KakeraCoin))
                                    {
                                        if (Object.op_Inequality((Object)component, (Object)null))
                                        {
                                            if (Object.op_Inequality((Object)component.CurrentIcon, (Object)null))
                                            {
                                                component.CurrentIcon.SetActive(false);
                                            }
                                            component.CurrentIcon = component.KakeraCoinIconTemplate;
                                            component.CurrentIcon.SetActive(true);
                                            break;
                                        }
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    MailListItem component1 = (MailListItem)mMailListItem.GetComponent <MailListItem>();
                    if (Object.op_Inequality((Object)component1, (Object)null))
                    {
                        component1.Set(data1.IsPeriod, data1.IsReadMail(), data1.post_at, data1.read);
                    }
                }
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Beispiel #13
0
        private void SetData()
        {
            GameManager          instance    = MonoSingleton <GameManager> .Instance;
            MultiTowerRewardItem dataOfClass = DataSource.FindDataOfClass <MultiTowerRewardItem>(((Component)this).get_gameObject(), (MultiTowerRewardItem)null);

            if (dataOfClass == null)
            {
                if (Object.op_Inequality((Object)this.itemObj, (Object)null))
                {
                    this.itemObj.SetActive(false);
                }
                if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                {
                    this.amountObj.SetActive(false);
                }
                if (Object.op_Inequality((Object)this.unitObj, (Object)null))
                {
                    this.unitObj.SetActive(false);
                }
                if (!Object.op_Inequality((Object)this.rewardName, (Object)null))
                {
                    return;
                }
                ((Component)this.rewardName).get_gameObject().SetActive(false);
            }
            else
            {
                MultiTowerRewardItem.RewardType type = dataOfClass.type;
                string itemname = dataOfClass.itemname;
                int    num      = dataOfClass.num;
                if (Object.op_Inequality((Object)this.itemObj, (Object)null))
                {
                    this.itemObj.SetActive(true);
                }
                if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                {
                    this.amountObj.SetActive(true);
                }
                if (Object.op_Inequality((Object)this.unitObj, (Object)null))
                {
                    this.unitObj.SetActive(false);
                }
                if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                {
                    ((Component)this.rewardName).get_gameObject().SetActive(true);
                }
                switch (type)
                {
                case MultiTowerRewardItem.RewardType.Item:
                    if (Object.op_Inequality((Object)this.artifactObj, (Object)null))
                    {
                        this.artifactObj.SetActive(false);
                    }
                    if (!Object.op_Inequality((Object)this.itemObj, (Object)null) || !Object.op_Inequality((Object)this.amountObj, (Object)null))
                    {
                        break;
                    }
                    this.itemObj.SetActive(true);
                    DataSource component1 = (DataSource)this.itemObj.GetComponent <DataSource>();
                    if (Object.op_Inequality((Object)component1, (Object)null))
                    {
                        component1.Clear();
                    }
                    DataSource component2 = (DataSource)this.amountObj.GetComponent <DataSource>();
                    if (Object.op_Inequality((Object)component2, (Object)null))
                    {
                        component2.Clear();
                    }
                    ItemParam itemParam = instance.GetItemParam(itemname);
                    DataSource.Bind <ItemParam>(this.itemObj, itemParam);
                    ItemData data1 = new ItemData();
                    data1.Setup(0L, itemParam, num);
                    DataSource.Bind <ItemData>(this.amountObj, data1);
                    Transform child1 = this.itemObj.get_transform().FindChild("icon");
                    if (Object.op_Inequality((Object)child1, (Object)null))
                    {
                        GameParameter component3 = (GameParameter)((Component)child1).GetComponent <GameParameter>();
                        if (Object.op_Inequality((Object)component3, (Object)null))
                        {
                            ((Behaviour)component3).set_enabled(true);
                        }
                    }
                    GameParameter.UpdateAll(this.itemObj);
                    if (Object.op_Inequality((Object)this.iconParam, (Object)null))
                    {
                        this.iconParam.UpdateValue();
                    }
                    if (Object.op_Inequality((Object)this.frameParam, (Object)null))
                    {
                        this.frameParam.UpdateValue();
                    }
                    if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                    {
                        this.rewardName.set_text(itemParam.name + string.Format(LocalizedText.Get("sys.CROSS_NUM"), (object)num));
                    }
                    if (!Object.op_Inequality((Object)this.amountOther, (Object)null))
                    {
                        break;
                    }
                    this.amountOther.SetActive(false);
                    break;

                case MultiTowerRewardItem.RewardType.Coin:
                    if (Object.op_Inequality((Object)this.artifactObj, (Object)null))
                    {
                        this.artifactObj.SetActive(false);
                    }
                    if (Object.op_Inequality((Object)this.itemTex, (Object)null))
                    {
                        GameParameter component3 = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>();
                        if (Object.op_Inequality((Object)component3, (Object)null))
                        {
                            ((Behaviour)component3).set_enabled(false);
                        }
                        this.itemTex.set_texture(this.coinTex);
                    }
                    if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.coinBase, (Object)null))
                    {
                        this.frameTex.set_sprite(this.coinBase);
                    }
                    if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                    {
                        this.rewardName.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)num));
                    }
                    if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                    {
                        this.amountObj.SetActive(false);
                    }
                    if (!Object.op_Inequality((Object)this.amountOther, (Object)null))
                    {
                        break;
                    }
                    if (this.amountDisp)
                    {
                        this.amountOther.SetActive(true);
                        if (!Object.op_Inequality((Object)this.amountCount, (Object)null))
                        {
                            break;
                        }
                        this.amountCount.set_text(dataOfClass.num.ToString());
                        break;
                    }
                    this.amountOther.SetActive(false);
                    break;

                case MultiTowerRewardItem.RewardType.Artifact:
                    if (Object.op_Inequality((Object)this.itemObj, (Object)null))
                    {
                        this.itemObj.SetActive(false);
                    }
                    if (!Object.op_Inequality((Object)this.artifactObj, (Object)null))
                    {
                        break;
                    }
                    this.artifactObj.SetActive(true);
                    DataSource component4 = (DataSource)this.artifactObj.GetComponent <DataSource>();
                    if (Object.op_Inequality((Object)component4, (Object)null))
                    {
                        component4.Clear();
                    }
                    ArtifactParam artifactParam = instance.MasterParam.GetArtifactParam(itemname);
                    DataSource.Bind <ArtifactParam>(this.artifactObj, artifactParam);
                    ArtifactIcon componentInChildren = (ArtifactIcon)this.artifactObj.GetComponentInChildren <ArtifactIcon>();
                    if (!Object.op_Inequality((Object)componentInChildren, (Object)null))
                    {
                        break;
                    }
                    ((Behaviour)componentInChildren).set_enabled(true);
                    componentInChildren.UpdateValue();
                    if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                    {
                        this.rewardName.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_ARTIFACT"), (object)artifactParam.name));
                    }
                    if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                    {
                        this.amountObj.SetActive(false);
                    }
                    if (!Object.op_Inequality((Object)this.Artifactamount, (Object)null))
                    {
                        break;
                    }
                    this.Artifactamount.set_text(dataOfClass.num.ToString());
                    break;

                case MultiTowerRewardItem.RewardType.Award:
                    if (Object.op_Inequality((Object)this.artifactObj, (Object)null))
                    {
                        this.artifactObj.SetActive(false);
                    }
                    if (!Object.op_Inequality((Object)this.itemObj, (Object)null) || !Object.op_Inequality((Object)this.amountObj, (Object)null))
                    {
                        break;
                    }
                    this.itemObj.SetActive(true);
                    AwardParam awardParam = instance.GetAwardParam(itemname);
                    Transform  child2     = this.itemObj.get_transform().FindChild("icon");
                    if (Object.op_Inequality((Object)child2, (Object)null))
                    {
                        IconLoader iconLoader = GameUtility.RequireComponent <IconLoader>(((Component)child2).get_gameObject());
                        if (!string.IsNullOrEmpty(awardParam.icon))
                        {
                            iconLoader.ResourcePath = AssetPath.ItemIcon(awardParam.icon);
                        }
                        GameParameter component3 = (GameParameter)((Component)child2).GetComponent <GameParameter>();
                        if (Object.op_Inequality((Object)component3, (Object)null))
                        {
                            ((Behaviour)component3).set_enabled(false);
                        }
                        if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                        {
                            this.rewardName.set_text(awardParam.name);
                        }
                    }
                    if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.coinBase, (Object)null))
                    {
                        this.frameTex.set_sprite(this.coinBase);
                    }
                    if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                    {
                        this.amountObj.SetActive(false);
                    }
                    if (!Object.op_Inequality((Object)this.amountOther, (Object)null))
                    {
                        break;
                    }
                    this.amountOther.SetActive(false);
                    break;

                case MultiTowerRewardItem.RewardType.Unit:
                    if (!Object.op_Inequality((Object)this.unitObj, (Object)null))
                    {
                        break;
                    }
                    if (Object.op_Inequality((Object)this.itemObj, (Object)null))
                    {
                        this.itemObj.SetActive(false);
                    }
                    if (Object.op_Inequality((Object)this.artifactObj, (Object)null))
                    {
                        this.artifactObj.SetActive(false);
                    }
                    this.unitObj.SetActive(true);
                    UnitParam unitParam = instance.GetUnitParam(itemname);
                    DebugUtility.Assert(unitParam != null, "Invalid unit:" + itemname);
                    UnitData data2 = new UnitData();
                    data2.Setup(itemname, 0, 1, 0, (string)null, 1, EElement.None, 0);
                    DataSource.Bind <UnitData>(this.unitObj, data2);
                    GameParameter.UpdateAll(this.unitObj);
                    if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                    {
                        this.rewardName.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_UNIT"), (object)unitParam.name));
                    }
                    if (!Object.op_Inequality((Object)this.amountOther, (Object)null))
                    {
                        break;
                    }
                    this.amountOther.SetActive(false);
                    break;

                case MultiTowerRewardItem.RewardType.Gold:
                    if (Object.op_Inequality((Object)this.artifactObj, (Object)null))
                    {
                        this.artifactObj.SetActive(false);
                    }
                    if (Object.op_Inequality((Object)this.itemTex, (Object)null))
                    {
                        GameParameter component3 = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>();
                        if (Object.op_Inequality((Object)component3, (Object)null))
                        {
                            ((Behaviour)component3).set_enabled(false);
                        }
                        this.itemTex.set_texture(this.goldTex);
                    }
                    if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.goldBase, (Object)null))
                    {
                        this.frameTex.set_sprite(this.goldBase);
                    }
                    if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                    {
                        this.rewardName.set_text(num.ToString() + LocalizedText.Get("sys.GOLD"));
                    }
                    if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                    {
                        this.amountObj.SetActive(false);
                    }
                    if (!Object.op_Inequality((Object)this.amountOther, (Object)null))
                    {
                        break;
                    }
                    if (this.amountDisp)
                    {
                        this.amountOther.SetActive(true);
                        if (!Object.op_Inequality((Object)this.amountCount, (Object)null))
                        {
                            break;
                        }
                        this.amountCount.set_text(dataOfClass.num.ToString());
                        break;
                    }
                    this.amountOther.SetActive(false);
                    break;
                }
            }
        }
Beispiel #14
0
        public void OnDetailClick()
        {
            GameManager          instance    = MonoSingleton <GameManager> .Instance;
            MultiTowerRewardItem dataOfClass = DataSource.FindDataOfClass <MultiTowerRewardItem>(((Component)this).get_gameObject(), (MultiTowerRewardItem)null);

            if (dataOfClass == null)
            {
                return;
            }
            MultiTowerRewardItem.RewardType type = dataOfClass.type;
            string itemname = dataOfClass.itemname;
            int    num      = 0;
            string str1     = string.Empty;
            string str2     = string.Empty;

            switch (type)
            {
            case MultiTowerRewardItem.RewardType.Item:
                ItemParam itemParam = instance.GetItemParam(itemname);
                if (itemParam != null)
                {
                    str1 = itemParam.name;
                    str2 = itemParam.Expr;
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Coin:
                str1 = LocalizedText.Get("sys.COIN");
                str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)num);
                break;

            case MultiTowerRewardItem.RewardType.Artifact:
                ArtifactParam artifactParam = instance.MasterParam.GetArtifactParam(itemname);
                if (artifactParam != null)
                {
                    str1 = string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_ARTIFACT"), (object)artifactParam.name);
                    str2 = artifactParam.Expr;
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Award:
                AwardParam awardParam = instance.GetAwardParam(itemname);
                if (awardParam != null)
                {
                    str1 = awardParam.name;
                    str2 = awardParam.expr;
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Unit:
                str1 = string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_UNIT"), (object)instance.GetUnitParam(itemname).name);
                break;

            case MultiTowerRewardItem.RewardType.Gold:
                str1 = LocalizedText.Get("sys.GOLD");
                str2 = num.ToString() + LocalizedText.Get("sys.GOLD");
                break;
            }
            if (Object.op_Inequality((Object)this.rewardDetailName, (Object)null))
            {
                this.rewardDetailName.set_text(str1);
            }
            if (Object.op_Inequality((Object)this.rewardDetailInfo, (Object)null))
            {
                this.rewardDetailInfo.set_text(str2);
            }
            if (Object.op_Inequality((Object)this.pos, (Object)null))
            {
                ((Transform)this.pos).set_position(((Component)this).get_gameObject().get_transform().get_position());
            }
            FlowNode_TriggerLocalEvent.TriggerLocalEvent((Component)this, "OPEN_DETAIL");
        }
Beispiel #15
0
        public void OnDetailClick()
        {
            GameManager      instance    = MonoSingleton <GameManager> .Instance;
            VersusTowerParam dataOfClass = DataSource.FindDataOfClass <VersusTowerParam>(((Component)this).get_gameObject(), (VersusTowerParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            VERSUS_ITEM_TYPE versusItemType = VERSUS_ITEM_TYPE.item;
            string           key            = string.Empty;
            int num = 0;

            if (this.mType == VersusTowerRewardItem.REWARD_TYPE.Arrival)
            {
                versusItemType = dataOfClass.ArrivalItemType;
                key            = (string)dataOfClass.ArrivalIteminame;
            }
            else if (this.mSeasonIdx >= 0 && this.mSeasonIdx < dataOfClass.SeasonIteminame.Length)
            {
                versusItemType = dataOfClass.SeasonItemType[this.mSeasonIdx];
                key            = (string)dataOfClass.SeasonIteminame[this.mSeasonIdx];
                num            = (int)dataOfClass.SeasonItemnum[this.mSeasonIdx];
            }
            string str1 = string.Empty;
            string str2 = string.Empty;

            switch (versusItemType)
            {
            case VERSUS_ITEM_TYPE.item:
                ItemParam itemParam = instance.GetItemParam(key);
                if (itemParam != null)
                {
                    str1 = itemParam.name;
                    str2 = itemParam.Expr;
                    break;
                }
                break;

            case VERSUS_ITEM_TYPE.gold:
                str1 = LocalizedText.Get("sys.GOLD");
                str2 = num.ToString() + LocalizedText.Get("sys.GOLD");
                break;

            case VERSUS_ITEM_TYPE.coin:
                str1 = LocalizedText.Get("sys.COIN");
                str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)num);
                break;

            case VERSUS_ITEM_TYPE.unit:
                str1 = string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_UNIT"), (object)instance.GetUnitParam(key).name);
                break;

            case VERSUS_ITEM_TYPE.artifact:
                ArtifactParam artifactParam = instance.MasterParam.GetArtifactParam(key);
                if (artifactParam != null)
                {
                    str1 = string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_ARTIFACT"), (object)artifactParam.name);
                    str2 = artifactParam.Expr;
                    break;
                }
                break;

            case VERSUS_ITEM_TYPE.award:
                AwardParam awardParam = instance.GetAwardParam(key);
                if (awardParam != null)
                {
                    str1 = awardParam.name;
                    str2 = awardParam.expr;
                    break;
                }
                break;
            }
            if (Object.op_Inequality((Object)this.rewardDetailName, (Object)null))
            {
                this.rewardDetailName.set_text(str1);
            }
            if (Object.op_Inequality((Object)this.rewardDetailInfo, (Object)null))
            {
                this.rewardDetailInfo.set_text(str2);
            }
            if (Object.op_Inequality((Object)this.pos, (Object)null))
            {
                ((Transform)this.pos).set_position(((Component)this).get_gameObject().get_transform().get_position());
            }
            FlowNode_TriggerLocalEvent.TriggerLocalEvent((Component)this, "OPEN_DETAIL");
        }
Beispiel #16
0
        public void SetData(VersusTowerRewardItem.REWARD_TYPE type, int idx = 0)
        {
            GameManager      instance    = MonoSingleton <GameManager> .Instance;
            VersusTowerParam dataOfClass = DataSource.FindDataOfClass <VersusTowerParam>(((Component)this).get_gameObject(), (VersusTowerParam)null);
            int versusTowerFloor         = instance.Player.VersusTowerFloor;

            if (dataOfClass == null)
            {
                return;
            }
            VERSUS_ITEM_TYPE versusItemType = VERSUS_ITEM_TYPE.item;
            string           str            = string.Empty;
            int num = 0;

            if (type == VersusTowerRewardItem.REWARD_TYPE.Arrival)
            {
                versusItemType = dataOfClass.ArrivalItemType;
                str            = (string)dataOfClass.ArrivalIteminame;
                num            = (int)dataOfClass.ArrivalItemNum;
            }
            else if (idx >= 0 && idx < dataOfClass.SeasonIteminame.Length)
            {
                versusItemType = dataOfClass.SeasonItemType[idx];
                str            = (string)dataOfClass.SeasonIteminame[idx];
                num            = (int)dataOfClass.SeasonItemnum[idx];
            }
            if (Object.op_Inequality((Object)this.itemObj, (Object)null))
            {
                this.itemObj.SetActive(true);
            }
            if (Object.op_Inequality((Object)this.amountObj, (Object)null))
            {
                this.amountObj.SetActive(true);
            }
            if (Object.op_Inequality((Object)this.unitObj, (Object)null))
            {
                this.unitObj.SetActive(false);
            }
            switch (versusItemType)
            {
            case VERSUS_ITEM_TYPE.item:
                if (Object.op_Inequality((Object)this.itemObj, (Object)null) && Object.op_Inequality((Object)this.amountObj, (Object)null))
                {
                    ArtifactIcon componentInChildren = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>();
                    if (Object.op_Inequality((Object)componentInChildren, (Object)null))
                    {
                        ((Behaviour)componentInChildren).set_enabled(false);
                    }
                    this.itemObj.SetActive(true);
                    DataSource component1 = (DataSource)this.itemObj.GetComponent <DataSource>();
                    if (Object.op_Inequality((Object)component1, (Object)null))
                    {
                        component1.Clear();
                    }
                    DataSource component2 = (DataSource)this.amountObj.GetComponent <DataSource>();
                    if (Object.op_Inequality((Object)component2, (Object)null))
                    {
                        component2.Clear();
                    }
                    ItemParam itemParam = instance.GetItemParam(str);
                    DataSource.Bind <ItemParam>(this.itemObj, itemParam);
                    ItemData data = new ItemData();
                    data.Setup(0L, itemParam, num);
                    DataSource.Bind <ItemData>(this.amountObj, data);
                    Transform child = this.itemObj.get_transform().FindChild("icon");
                    if (Object.op_Inequality((Object)child, (Object)null))
                    {
                        GameParameter component3 = (GameParameter)((Component)child).GetComponent <GameParameter>();
                        if (Object.op_Inequality((Object)component3, (Object)null))
                        {
                            ((Behaviour)component3).set_enabled(true);
                        }
                    }
                    GameParameter.UpdateAll(this.itemObj);
                    if (Object.op_Inequality((Object)this.iconParam, (Object)null))
                    {
                        this.iconParam.UpdateValue();
                    }
                    if (Object.op_Inequality((Object)this.frameParam, (Object)null))
                    {
                        this.frameParam.UpdateValue();
                    }
                    if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                    {
                        this.rewardName.set_text(itemParam.name + string.Format(LocalizedText.Get("sys.CROSS_NUM"), (object)num));
                        break;
                    }
                    break;
                }
                break;

            case VERSUS_ITEM_TYPE.gold:
                if (Object.op_Inequality((Object)this.itemTex, (Object)null))
                {
                    GameParameter component = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        ((Behaviour)component).set_enabled(false);
                    }
                    this.itemTex.set_texture(this.goldTex);
                }
                if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.goldBase, (Object)null))
                {
                    this.frameTex.set_sprite(this.goldBase);
                }
                if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                {
                    this.rewardName.set_text(num.ToString() + LocalizedText.Get("sys.GOLD"));
                }
                if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                {
                    this.amountObj.SetActive(false);
                    break;
                }
                break;

            case VERSUS_ITEM_TYPE.coin:
                if (Object.op_Inequality((Object)this.itemTex, (Object)null))
                {
                    GameParameter component = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        ((Behaviour)component).set_enabled(false);
                    }
                    this.itemTex.set_texture(this.coinTex);
                }
                if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.coinBase, (Object)null))
                {
                    this.frameTex.set_sprite(this.coinBase);
                }
                if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                {
                    this.rewardName.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)num));
                }
                if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                {
                    this.amountObj.SetActive(false);
                    break;
                }
                break;

            case VERSUS_ITEM_TYPE.unit:
                if (Object.op_Inequality((Object)this.unitObj, (Object)null))
                {
                    if (Object.op_Inequality((Object)this.itemObj, (Object)null))
                    {
                        this.itemObj.SetActive(false);
                    }
                    this.unitObj.SetActive(true);
                    UnitParam unitParam = instance.GetUnitParam(str);
                    DebugUtility.Assert(unitParam != null, "Invalid unit:" + str);
                    UnitData data = new UnitData();
                    data.Setup(str, 0, 1, 0, (string)null, 1, EElement.None, 0);
                    DataSource.Bind <UnitData>(this.unitObj, data);
                    GameParameter.UpdateAll(this.unitObj);
                    if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                    {
                        this.rewardName.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_UNIT"), (object)unitParam.name));
                        break;
                    }
                    break;
                }
                break;

            case VERSUS_ITEM_TYPE.artifact:
                if (Object.op_Inequality((Object)this.itemObj, (Object)null))
                {
                    DataSource component = (DataSource)this.itemObj.GetComponent <DataSource>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        component.Clear();
                    }
                    ArtifactParam artifactParam = instance.MasterParam.GetArtifactParam(str);
                    DataSource.Bind <ArtifactParam>(this.itemObj, artifactParam);
                    ArtifactIcon componentInChildren = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>();
                    if (Object.op_Inequality((Object)componentInChildren, (Object)null))
                    {
                        ((Behaviour)componentInChildren).set_enabled(true);
                        componentInChildren.UpdateValue();
                        if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                        {
                            this.rewardName.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_ARTIFACT"), (object)artifactParam.name));
                        }
                        if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                        {
                            this.amountObj.SetActive(false);
                            break;
                        }
                        break;
                    }
                    break;
                }
                break;

            case VERSUS_ITEM_TYPE.award:
                if (Object.op_Inequality((Object)this.itemObj, (Object)null) && Object.op_Inequality((Object)this.amountObj, (Object)null))
                {
                    ArtifactIcon componentInChildren = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>();
                    if (Object.op_Inequality((Object)componentInChildren, (Object)null))
                    {
                        ((Behaviour)componentInChildren).set_enabled(false);
                    }
                    this.itemObj.SetActive(true);
                    AwardParam awardParam = instance.GetAwardParam(str);
                    Transform  child      = this.itemObj.get_transform().FindChild("icon");
                    if (Object.op_Inequality((Object)child, (Object)null))
                    {
                        IconLoader iconLoader = GameUtility.RequireComponent <IconLoader>(((Component)child).get_gameObject());
                        if (!string.IsNullOrEmpty(awardParam.icon))
                        {
                            iconLoader.ResourcePath = AssetPath.ItemIcon(awardParam.icon);
                        }
                        GameParameter component = (GameParameter)((Component)child).GetComponent <GameParameter>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            ((Behaviour)component).set_enabled(false);
                        }
                    }
                    if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.coinBase, (Object)null))
                    {
                        this.frameTex.set_sprite(this.coinBase);
                    }
                    if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                    {
                        this.amountObj.SetActive(false);
                        break;
                    }
                    break;
                }
                break;
            }
            this.mType      = type;
            this.mSeasonIdx = idx;
            if (type == VersusTowerRewardItem.REWARD_TYPE.Arrival)
            {
                if (Object.op_Inequality((Object)this.currentMark, (Object)null))
                {
                    this.currentMark.SetActive((int)dataOfClass.Floor - 1 == versusTowerFloor);
                }
                if (Object.op_Inequality((Object)this.current_fil, (Object)null))
                {
                    this.current_fil.SetActive((int)dataOfClass.Floor - 1 == versusTowerFloor);
                }
            }
            else
            {
                if (Object.op_Inequality((Object)this.currentMark, (Object)null))
                {
                    this.currentMark.SetActive((int)dataOfClass.Floor == versusTowerFloor);
                }
                if (Object.op_Inequality((Object)this.current_fil, (Object)null))
                {
                    this.current_fil.SetActive((int)dataOfClass.Floor == versusTowerFloor);
                }
            }
            if (Object.op_Inequality((Object)this.clearMark, (Object)null))
            {
                this.clearMark.SetActive((int)dataOfClass.Floor - 1 < versusTowerFloor);
            }
            if (!Object.op_Inequality((Object)this.cleared_fil, (Object)null))
            {
                return;
            }
            this.cleared_fil.SetActive((int)dataOfClass.Floor - 1 < versusTowerFloor);
        }
        private void SetRewardName(int idx, VersusTowerParam param)
        {
            GameManager      instance       = MonoSingleton <GameManager> .Instance;
            int              num            = (int)param.SeasonItemnum[idx];
            string           key            = (string)param.SeasonIteminame[idx];
            VERSUS_ITEM_TYPE versusItemType = param.SeasonItemType[idx];
            string           str1           = LocalizedText.Get("sys.MULTI_VERSUS_REWARD_GET_MSG");

            if (!Object.op_Inequality((Object)this.rewardTxt, (Object)null))
            {
                return;
            }
            string str2 = string.Empty;

            switch (versusItemType)
            {
            case VERSUS_ITEM_TYPE.item:
                ItemParam itemParam = instance.GetItemParam(key);
                if (itemParam != null)
                {
                    str2 = itemParam.name + string.Format(LocalizedText.Get("sys.CROSS_NUM"), (object)num);
                    break;
                }
                break;

            case VERSUS_ITEM_TYPE.gold:
                str2 = num.ToString() + LocalizedText.Get("sys.GOLD");
                break;

            case VERSUS_ITEM_TYPE.coin:
                str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)num);
                break;

            case VERSUS_ITEM_TYPE.unit:
                UnitParam unitParam = instance.GetUnitParam(key);
                if (unitParam != null)
                {
                    str2 = unitParam.name;
                    break;
                }
                break;

            case VERSUS_ITEM_TYPE.artifact:
                ArtifactParam artifactParam = instance.MasterParam.GetArtifactParam(key);
                if (artifactParam != null)
                {
                    str2 = artifactParam.name;
                    break;
                }
                break;

            case VERSUS_ITEM_TYPE.award:
                AwardParam awardParam = instance.GetAwardParam(key);
                if (awardParam != null)
                {
                    str2 = awardParam.name;
                }
                str1 = LocalizedText.Get("sys.MULTI_VERSUS_REWARD_GET_AWARD");
                break;
            }
            this.rewardTxt.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_NAME"), (object)str2));
            if (!Object.op_Inequality((Object)this.getTxt, (Object)null))
            {
                return;
            }
            this.getTxt.set_text(str1);
        }