예제 #1
0
        public void Refresh(ChatBlackListParam param)
        {
            if (param == null)
            {
                return;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Name, (UnityEngine.Object)null))
            {
                this.Name.set_text(param.name);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Lv, (UnityEngine.Object)null))
            {
                this.Lv.set_text(PlayerData.CalcLevelFromExp(param.exp).ToString());
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LastLogin, (UnityEngine.Object)null))
            {
                this.LastLogin.set_text(ChatLogItem.GetPostAt(param.lastlogin));
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Icon, (UnityEngine.Object)null))
            {
                return;
            }
            UnitParam unitParam = MonoSingleton <GameManager> .Instance.MasterParam.GetUnitParam(param.icon);

            if (unitParam == null)
            {
                return;
            }
            if (!string.IsNullOrEmpty(param.skin_iname))
            {
                ArtifactParam skin = Array.Find <ArtifactParam>(MonoSingleton <GameManager> .Instance.MasterParam.Artifacts.ToArray(), (Predicate <ArtifactParam>)(p => p.iname == param.skin_iname));
                MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, AssetPath.UnitSkinIconSmall(unitParam, skin, param.job_iname));
            }
            else
            {
                MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, AssetPath.UnitIconSmall(unitParam, param.job_iname));
            }
        }
예제 #2
0
        public void Refresh()
        {
            TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(GlobalVars.SelectedQuestID);

            if (towerFloor == null)
            {
                return;
            }
            QuestParam questParam = towerFloor.GetQuestParam();

            DataSource.Bind <QuestParam>(((Component)this).get_gameObject(), questParam);
            this.SetRecommendText((int)towerFloor.lv, (int)towerFloor.joblv);
            int             downloadAssetNum = ((FlowNode_DownloadTowerMapSets)((Component)this).GetComponentInParent <FlowNode_DownloadTowerMapSets>()).DownloadAssetNum;
            TowerFloorParam currentFloor     = MonoSingleton <GameManager> .Instance.TowerResuponse.GetCurrentFloor();

            if (currentFloor == null)
            {
                return;
            }
            if ((int)towerFloor.FloorIndex < (int)currentFloor.FloorIndex + downloadAssetNum)
            {
                if (questParam.state == QuestStates.Cleared)
                {
                    GameUtility.SetGameObjectActive(this.UnkownIcon, false);
                    GameUtility.SetGameObjectActive((Component)this.RewardText, true);
                    GameUtility.SetGameObjectActive(this.ClearIcon, true);
                    for (int index = 0; index < this.EnemyList.Count; ++index)
                    {
                        ((Component)this.EnemyList[index]).get_gameObject().SetActive(false);
                    }
                    for (int index = 0; index < this.UnknownEnemyList.Count; ++index)
                    {
                        ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false);
                    }
                    this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id));
                }
                else
                {
                    string path = AssetPath.LocalMap(towerFloor.map[0].mapSetName);
                    string src  = AssetManager.LoadTextData(path);
                    if (string.IsNullOrEmpty(src))
                    {
                        DebugUtility.LogError("配置ファイルがありません : QuestIname = " + towerFloor.iname + ",SetFilePath = " + path);
                        return;
                    }
                    JSON_MapUnit jsonObject = JSONParser.parseJSONObject <JSON_MapUnit>(src);
                    GameUtility.SetGameObjectActive(this.UnkownIcon, false);
                    GameUtility.SetGameObjectActive((Component)this.RewardText, true);
                    GameUtility.SetGameObjectActive(this.ClearIcon, false);
                    TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
                    if ((int)jsonObject.is_rand > 0)
                    {
                        if (towerResuponse.lot_enemies == null || (int)towerFloor.FloorIndex > (int)currentFloor.FloorIndex)
                        {
                            for (int index = 0; index < this.EnemyList.Count; ++index)
                            {
                                ((Component)this.EnemyList[index]).get_gameObject().SetActive(false);
                            }
                            this.EnemyTemplateUnKnown.SetActive(true);
                            int num = 0;
                            for (int index = 0; index < towerFloor.rand_tag.Length; ++index)
                            {
                                num += (int)towerFloor.rand_tag[index];
                            }
                            for (int index = 0; index < num; ++index)
                            {
                                if (index >= this.UnknownEnemyList.Count)
                                {
                                    TowerEnemyListItem component = (TowerEnemyListItem)((GameObject)Object.Instantiate <GameObject>((M0)this.EnemyTemplateUnKnown)).GetComponent <TowerEnemyListItem>();
                                    ((Component)component).get_transform().SetParent(this.EnemiesRoot.get_transform(), false);
                                    this.UnknownEnemyList.Add(component);
                                }
                                ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(true);
                            }
                            for (int index = num; index < this.UnknownEnemyList.Count; ++index)
                            {
                                ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false);
                            }
                            this.EnemyTemplateUnKnown.SetActive(false);
                        }
                        else
                        {
                            List <JSON_MapEnemyUnit> randFixedUnit = jsonObject.GetRandFixedUnit();
                            jsonObject.enemy = new JSON_MapEnemyUnit[towerResuponse.lot_enemies.Length];
                            for (int index = 0; index < jsonObject.enemy.Length; ++index)
                            {
                                jsonObject.enemy[index] = jsonObject.deck[(int)towerResuponse.lot_enemies[index]];
                            }
                            List <JSON_MapEnemyUnit> jsonMapEnemyUnitList = new List <JSON_MapEnemyUnit>((IEnumerable <JSON_MapEnemyUnit>)jsonObject.enemy);
                            jsonMapEnemyUnitList.AddRange((IEnumerable <JSON_MapEnemyUnit>)randFixedUnit);
                            jsonObject.enemy = jsonMapEnemyUnitList.ToArray();
                            this.SetEnemies(jsonObject.enemy);
                        }
                    }
                    else if (jsonObject.enemy != null)
                    {
                        this.SetEnemies(jsonObject.enemy);
                    }
                    this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id));
                }
            }
            else
            {
                GameUtility.SetGameObjectActive(this.UnkownIcon, true);
                GameUtility.SetGameObjectActive((Component)this.RewardText, true);
                GameUtility.SetGameObjectActive(this.ClearIcon, false);
                if (Object.op_Inequality((Object)this.UnkownIcon, (Object)null))
                {
                    Text component = (Text)this.UnkownIcon.GetComponent <Text>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        component.set_text(LocalizedText.Get("sys.TOWER_UNKNOWN_TEXT", new object[1]
                        {
                            (object)((int)towerFloor.FloorIndex - downloadAssetNum + 1)
                        }));
                    }
                }
                for (int index = 0; index < this.EnemyList.Count; ++index)
                {
                    ((Component)this.EnemyList[index]).get_gameObject().SetActive(false);
                }
                for (int index = 0; index < this.UnknownEnemyList.Count; ++index)
                {
                    ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false);
                }
                this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id));
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            this.FloorID = GlobalVars.SelectedQuestID;
        }
예제 #3
0
        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);
        }
예제 #4
0
 private string GetSecretIconPath()
 {
     return(AssetPath.ItemIcon("IT_UNKNOWN"));
 }
예제 #5
0
        public void Refresh(int rank_num, RankingUnitData data)
        {
            GameManager instance  = MonoSingleton <GameManager> .Instance;
            JobParam    jobParam  = instance.GetJobParam(data.job_iname);
            UnitParam   unitParam = instance.GetUnitParam(data.unit_iname);
            UnitData    data1     = new UnitData();

            data1.Setup(unitParam.iname, 0, 1, 1, jobParam.iname, 1, unitParam.element);
            DataSource.Bind <UnitData>(((Component)this).get_gameObject(), data1);
            if (Object.op_Inequality((Object)this.rank, (Object)null))
            {
                this.rank.set_text(LocalizedText.Get("sys.RANKING_RANK", new object[1]
                {
                    (object)rank_num
                }));
            }
            if (Object.op_Inequality((Object)this.unit_name, (Object)null))
            {
                this.unit_name.set_text(LocalizedText.Get("sys.RANKING_UNIT_NAME", (object)data1.UnitParam.name, (object)jobParam.name));
            }
            ((Behaviour)this.RankIconArray).set_enabled(this.RankIconArray.Images.Length >= rank_num);
            ((Behaviour)this.rank).set_enabled(!((Behaviour)this.RankIconArray).get_enabled());
            if (Object.op_Inequality((Object)this.JobIcon, (Object)null))
            {
                MonoSingleton <GameManager> .Instance.ApplyTextureAsync((RawImage)this.JobIcon, jobParam == null?(string)null : AssetPath.JobIconSmall(jobParam));
            }
            if (!((Behaviour)this.RankIconArray).get_enabled())
            {
                return;
            }
            this.RankIconArray.ImageIndex = rank_num - 1;
        }
예제 #6
0
        public void Refresh(UnitParam param, string shard_name = "", int awake_lv = 0, int get_shard = 0, int current_index = 0)
        {
            if (param == null)
            {
                return;
            }
            GameManager instance1 = MonoSingleton <GameManager> .Instance;

            this.InitRebirthStar();
            this.rebirthstar_template.SetActive(false);
            this.mNotUnlockUnit = true;
            this.mget_shard     = get_shard;
            this.msub_shard     = this.GetPastShard(current_index, (string)param.piece);
            this.muse_shard     = 0;
            this.mstart_gauge   = 0;
            this.mremain_shard  = this.mget_shard;
            UnitData unitDataByUnitId = instance1.Player.FindUnitDataByUnitID(param.iname);

            this.mCurrentUnitIname = param.iname;
            string path1 = AssetPath.UnitImage(param, param.GetJobId(0));

            instance1.ApplyTextureAsync(this.unit_img, path1);
            instance1.ApplyTextureAsync(this.unit_img_blur01, path1);
            instance1.ApplyTextureAsync(this.unit_img_blur02, path1);
            string path2 = AssetPath.UnitIconSmall(param, param.GetJobId(0));

            instance1.ApplyTextureAsync((RawImage)this.unit_icon, path2);
            GameSettings instance2 = GameSettings.Instance;

            if (unitDataByUnitId != null && EElement.None <= unitDataByUnitId.Element && unitDataByUnitId.Element < (EElement)instance2.Elements_IconSmall.Length)
            {
                this.element_icon.set_sprite(instance2.Elements_IconSmall[(int)unitDataByUnitId.Element]);
            }
            else
            {
                this.element_icon.set_sprite((Sprite)null);
            }
            this.ShardName.set_text(shard_name);
            this.StartAwakeLv = this.NowAwakeLv = awake_lv;
            if (unitDataByUnitId != null)
            {
                this.mNotUnlockUnit = false;
                this.AwakeLvCap     = unitDataByUnitId.GetAwakeLevelCap();
                int num1 = (int)instance1.MasterParam.GetRarityParam(unitDataByUnitId.Rarity).UnitAwakeLvCap / 5;
                for (int index = 0; index < num1; ++index)
                {
                    GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.rebirthstar_template);
                    gameObject.get_transform().SetParent(this.rebirthstar_root.get_transform(), false);
                    gameObject.SetActive(true);
                    this.mRebirthStars.Add(gameObject);
                }
                int index1 = this.StartAwakeLv / 5;
                for (int index2 = 0; index2 < index1 && this.mRebirthStars.Count >= index2; ++index2)
                {
                    Transform child = this.mRebirthStars[index2].get_transform().FindChild("Rebirth_star_anim");
                    ((Component)child.FindChild("Rebirthstar_01")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_02")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_03")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_04")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_05")).get_gameObject().SetActive(true);
                }
                int num2 = this.StartAwakeLv % 5;
                if (num2 > 0)
                {
                    Transform child = this.mRebirthStars[index1].get_transform().FindChild("Rebirth_star_anim");
                    for (int index2 = 0; index2 < num2; ++index2)
                    {
                        string str = "Rebirthstar_0" + (object)(index2 + 1);
                        ((Component)child.FindChild(str)).get_gameObject().SetActive(true);
                    }
                }
                if (this.msub_shard > 0)
                {
                    int startAwakeLv    = this.StartAwakeLv;
                    int msubShard       = this.msub_shard;
                    int awakeNeedPieces = instance1.MasterParam.GetAwakeNeedPieces(startAwakeLv);
                    int num3            = this.AwakeLvCap / 5;
                    while (msubShard >= awakeNeedPieces)
                    {
                        int       num4  = startAwakeLv / 5;
                        int       num5  = Math.Min(5, startAwakeLv % 5) + 1;
                        Transform child = this.mRebirthStars[num4 + 1 < num3 ? num4 : num3 - 1].get_transform().FindChild("Rebirth_star_anim").FindChild("Rebirthstar_0" + num5.ToString());
                        if (Object.op_Inequality((Object)child, (Object)null))
                        {
                            ((Component)child).get_gameObject().SetActive(true);
                        }
                        ++startAwakeLv;
                        if (startAwakeLv < this.AwakeLvCap)
                        {
                            msubShard      -= awakeNeedPieces;
                            awakeNeedPieces = instance1.MasterParam.GetAwakeNeedPieces(startAwakeLv);
                            if (msubShard < awakeNeedPieces)
                            {
                                break;
                            }
                        }
                        else
                        {
                            break;
                        }
                    }
                    if (Object.op_Inequality((Object)this.ShardNext, (Object)null))
                    {
                        this.ShardNext.set_text(awakeNeedPieces.ToString());
                    }
                    if (Object.op_Inequality((Object)this.ShardCurrent, (Object)null))
                    {
                        this.ShardCurrent.set_text(msubShard.ToString());
                    }
                    this.mstart_gauge = msubShard;
                    this.ShardGauge.AnimateValue((float)msubShard / (float)awakeNeedPieces, 0.0f);
                    this.StartAwakeLv = startAwakeLv;
                    this.NowAwakeLv   = this.StartAwakeLv;
                    this.NextAwakeLv  = this.StartAwakeLv + 1 <= this.AwakeLvCap ? this.StartAwakeLv + 1 : this.AwakeLvCap;
                }
            }
            int num = unitDataByUnitId == null?param.GetUnlockNeedPieces() : instance1.MasterParam.GetAwakeNeedPieces(this.StartAwakeLv);

            this.mnext_shard = num;
            this.muse_shard  = this.mget_shard >= num ? num : this.mget_shard;
            if (this.mstart_gauge > 0 && this.mstart_gauge + this.muse_shard > this.mnext_shard)
            {
                this.muse_shard -= this.mstart_gauge;
            }
            this.mremain_shard -= this.muse_shard;
            if (unitDataByUnitId == null && this.muse_shard >= this.mnext_shard)
            {
                this.mUnlockUnit = true;
            }
            if (this.muse_shard >= this.mnext_shard && this.msub_shard <= 0)
            {
                this.NextAwakeLv = this.NowAwakeLv + 1 <= this.AwakeLvCap ? this.NowAwakeLv + 1 : this.AwakeLvCap;
            }
            if (param.jobsets != null && param.jobsets.Length > 0)
            {
                this.mJobID      = new List <string>();
                this.mJobAwakeLv = new List <int>();
                for (int index = 0; index < param.jobsets.Length; ++index)
                {
                    JobSetParam jobSetParam = MonoSingleton <GameManager> .Instance.GetJobSetParam((string)param.jobsets[index]);

                    if (jobSetParam != null && jobSetParam.lock_awakelv > 0 && (unitDataByUnitId == null || !unitDataByUnitId.Jobs[index].IsActivated) && this.StartAwakeLv < jobSetParam.lock_awakelv)
                    {
                        this.mJobID.Add(jobSetParam.job);
                        this.mJobAwakeLv.Add(jobSetParam.lock_awakelv);
                    }
                }
                if (this.mJobID != null && this.mJobID.Count > 1)
                {
                    JobParam jobParam = MonoSingleton <GameManager> .Instance.GetJobParam(this.mJobID[0]);

                    this.JobName.set_text(jobParam.name);
                    this.JobComment.set_text(LocalizedText.Get("sys.GACHA_TEXT_SHARD_AWAKE", new object[1]
                    {
                        (object)jobParam.name
                    }));
                }
            }
            this.isRunningAnimator = true;
        }
예제 #7
0
        public void Refresh()
        {
            TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(GlobalVars.SelectedQuestID);

            if (towerFloor == null)
            {
                return;
            }
            QuestParam questParam = towerFloor.GetQuestParam();

            DataSource.Bind <QuestParam>(((Component)this).get_gameObject(), questParam);
            this.SetRecommendText((int)towerFloor.lv, (int)towerFloor.joblv);
            int             downloadAssetNum = ((FlowNode_DownloadTowerMapSets)((Component)this).GetComponentInParent <FlowNode_DownloadTowerMapSets>()).DownloadAssetNum;
            TowerFloorParam currentFloor     = MonoSingleton <GameManager> .Instance.TowerResuponse.GetCurrentFloor();

            if (currentFloor == null)
            {
                return;
            }
            if ((int)towerFloor.FloorIndex < (int)currentFloor.FloorIndex + downloadAssetNum)
            {
                if (questParam.state == QuestStates.Cleared)
                {
                    GameUtility.SetGameObjectActive(this.UnkownIcon, false);
                    GameUtility.SetGameObjectActive((Component)this.RewardText, true);
                    GameUtility.SetGameObjectActive(this.ClearIcon, true);
                    this.HideAllEnemyIcon();
                    this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id));
                }
                else
                {
                    string path = AssetPath.LocalMap(towerFloor.map[0].mapSetName);
                    string src  = AssetManager.LoadTextData(path);
                    if (string.IsNullOrEmpty(src))
                    {
                        DebugUtility.LogError("配置ファイルがありません : QuestIname = " + towerFloor.iname + ",SetFilePath = " + path);
                        return;
                    }
                    JSON_MapUnit jsonObject = JSONParser.parseJSONObject <JSON_MapUnit>(src);
                    GameUtility.SetGameObjectActive(this.UnkownIcon, false);
                    GameUtility.SetGameObjectActive((Component)this.RewardText, true);
                    GameUtility.SetGameObjectActive(this.ClearIcon, false);
                    TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
                    this.HideAllEnemyIcon();
                    if (jsonObject.enemy != null)
                    {
                        TowerFloorParam towerFloorParam = (TowerFloorParam)null;
                        if (MonoSingleton <GameManager> .Instance.TowerResuponse != null)
                        {
                            towerFloorParam = MonoSingleton <GameManager> .Instance.TowerResuponse.GetCurrentFloor();
                        }
                        bool flag1 = towerResuponse.lot_enemies != null && towerResuponse.lot_enemies.Length > 0;
                        bool flag2 = towerFloor.iname == currentFloor.iname;
                        if (flag1 && flag2)
                        {
                            jsonObject.enemy = jsonObject.ReplacedRandEnemy(towerResuponse.lot_enemies, false);
                        }
                        List <TowerQuestInfo.EnemyIconData> enemyIconDataList1 = new List <TowerQuestInfo.EnemyIconData>();
                        for (int i = 0; i < jsonObject.enemy.Length; ++i)
                        {
                            bool flag3 = false;
                            if (jsonObject.enemy[i].IsRandSymbol)
                            {
                                flag3 = true;
                            }
                            if (flag1 && flag2)
                            {
                                flag3 = Array.Find <RandDeckResult>(towerResuponse.lot_enemies, (Predicate <RandDeckResult>)(lot => lot.set_id == i)) != null;
                            }
                            Unit unit = (Unit)null;
                            if (!jsonObject.enemy[i].IsRandSymbol)
                            {
                                NPCSetting npcSetting = new NPCSetting(jsonObject.enemy[i]);
                                unit = new Unit();
                                unit.Setup((UnitData)null, (UnitSetting)npcSetting, (Unit.DropItem)null, (Unit.DropItem)null);
                            }
                            enemyIconDataList1.Add(new TowerQuestInfo.EnemyIconData()
                            {
                                unit    = unit,
                                enemy   = jsonObject.enemy[i],
                                is_rand = flag3
                            });
                        }
                        List <TowerQuestInfo.EnemyIconData> enemyIconDataList2 = new List <TowerQuestInfo.EnemyIconData>();
                        for (int index = 0; index < enemyIconDataList1.Count; ++index)
                        {
                            if (!enemyIconDataList1[index].enemy.IsRandSymbol && !enemyIconDataList1[index].unit.IsGimmick)
                            {
                                enemyIconDataList2.Add(enemyIconDataList1[index]);
                            }
                        }
                        List <TowerQuestInfo.EnemyIconData> enemyIconDataList3 = new List <TowerQuestInfo.EnemyIconData>((IEnumerable <TowerQuestInfo.EnemyIconData>)enemyIconDataList2);
                        if (towerFloorParam != null && towerFloorParam.iname == GlobalVars.SelectedQuestID && MonoSingleton <GameManager> .Instance.TowerEnemyUnit != null)
                        {
                            for (int index = 0; index < enemyIconDataList3.Count; ++index)
                            {
                                if (enemyIconDataList3[index].unit != null)
                                {
                                    int num = (int)enemyIconDataList3[index].unit.MaximumStatus.param.hp - MonoSingleton <GameManager> .Instance.TowerEnemyUnit[index].hp;
                                    enemyIconDataList3[index].unit.Damage(num, false);
                                }
                            }
                        }
                        List <TowerQuestInfo.EnemyIconData> icon_datas         = new List <TowerQuestInfo.EnemyIconData>();
                        List <TowerQuestInfo.EnemyIconData> enemyIconDataList4 = new List <TowerQuestInfo.EnemyIconData>();
                        List <TowerQuestInfo.EnemyIconData> enemyIconDataList5 = new List <TowerQuestInfo.EnemyIconData>();
                        for (int index = 0; index < enemyIconDataList3.Count; ++index)
                        {
                            if (!enemyIconDataList3[index].is_rand)
                            {
                                enemyIconDataList4.Add(enemyIconDataList3[index]);
                            }
                        }
                        if (towerResuponse.lot_enemies == null || (int)towerFloor.FloorIndex > (int)currentFloor.FloorIndex)
                        {
                            if (jsonObject.deck != null && jsonObject.deck.Length > 0 && (jsonObject.rand_tag != null && jsonObject.rand_tag.Length > 0))
                            {
                                int num = 0;
                                for (int index = 0; index < jsonObject.rand_tag.Length; ++index)
                                {
                                    num += jsonObject.rand_tag[index].spawn;
                                }
                                for (int index = 0; index < num; ++index)
                                {
                                    TowerQuestInfo.EnemyIconData enemyIconData = new TowerQuestInfo.EnemyIconData();
                                    enemyIconDataList5.Add(enemyIconData);
                                }
                            }
                        }
                        else
                        {
                            for (int index = 0; index < enemyIconDataList3.Count; ++index)
                            {
                                if (enemyIconDataList3[index].is_rand)
                                {
                                    enemyIconDataList5.Add(enemyIconDataList3[index]);
                                }
                            }
                        }
                        icon_datas.AddRange((IEnumerable <TowerQuestInfo.EnemyIconData>)enemyIconDataList4);
                        icon_datas.AddRange((IEnumerable <TowerQuestInfo.EnemyIconData>)enemyIconDataList5);
                        this.SetIcon(icon_datas);
                    }
                    this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id));
                }
            }
            else
            {
                GameUtility.SetGameObjectActive(this.UnkownIcon, true);
                GameUtility.SetGameObjectActive((Component)this.RewardText, true);
                GameUtility.SetGameObjectActive(this.ClearIcon, false);
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.UnkownIcon, (UnityEngine.Object)null))
                {
                    Text component = (Text)this.UnkownIcon.GetComponent <Text>();
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                    {
                        component.set_text(LocalizedText.Get("sys.TOWER_UNKNOWN_TEXT", new object[1]
                        {
                            (object)((int)towerFloor.FloorIndex - downloadAssetNum + 1)
                        }));
                    }
                }
                this.HideAllEnemyIcon();
                this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id));
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_BattleResetCost, (UnityEngine.Object)null))
            {
                this.m_BattleResetCost.set_text(MonoSingleton <GameManager> .Instance.FindTower(towerFloor.tower_id).floor_reset_coin.ToString());
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            this.FloorID = GlobalVars.SelectedQuestID;
        }
예제 #8
0
        public override void UpdateValue()
        {
            KeyItem dataOfClass1 = DataSource.FindDataOfClass <KeyItem>(((Component)this).get_gameObject(), (KeyItem)null);

            if (dataOfClass1 != null)
            {
                ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(dataOfClass1.iname);

                if (itemParam != null)
                {
                    ItemData itemDataByItemParam = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemParam(itemParam);

                    int num = itemDataByItemParam == null ? 0 : itemDataByItemParam.Num;
                    if (Object.op_Inequality((Object)this.Icon, (Object)null))
                    {
                        MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, AssetPath.ItemIcon(itemParam));
                    }
                    if (Object.op_Inequality((Object)this.Frame, (Object)null))
                    {
                        this.Frame.set_sprite(GameSettings.Instance.GetItemFrame(itemParam));
                    }
                    if (Object.op_Inequality((Object)this.UseNum, (Object)null))
                    {
                        this.UseNum.set_text(dataOfClass1.num.ToString());
                    }
                    if (Object.op_Inequality((Object)this.Amount, (Object)null))
                    {
                        this.Amount.set_text(num.ToString());
                    }
                    if (Object.op_Inequality((Object)this.Locked, (Object)null))
                    {
                        ChapterParam dataOfClass2 = DataSource.FindDataOfClass <ChapterParam>(((Component)this).get_gameObject(), (ChapterParam)null);
                        this.Locked.SetActive(dataOfClass2 == null || !dataOfClass2.IsKeyQuest() || !dataOfClass2.IsKeyUnlock(Network.GetServerTime()));
                    }
                }
            }
            if (Object.op_Inequality((Object)this.QuestTimer, (Object)null))
            {
                this.QuestTimer.UpdateValue();
            }
            if (!Object.op_Inequality((Object)this.IconRoot, (Object)null) || !Object.op_Inequality((Object)this.Locked, (Object)null))
            {
                return;
            }
            this.IconRoot.SetActive(this.Locked.get_activeSelf());
        }
예제 #9
0
 public static string UnitCurrentJobIconMedium(UnitData unit)
 {
     return(AssetPath.JobIconMedium(unit.CurrentJob == null ? (JobParam)null : unit.CurrentJob.Param));
 }
예제 #10
0
 private void RefreshIconImage()
 {
     if (this.mConceptCard == null || Object.op_Equality((Object)this.mIconImage, (Object)null))
     {
         MonoSingleton <GameManager> .Instance.CancelTextureLoadRequest(this.mIconImage);
     }
     else
     {
         MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.mIconImage, AssetPath.ConceptCardIcon(this.mConceptCard.Param));
     }
 }
예제 #11
0
        public void SetIcon(Transform body, JobParam job)
        {
            Transform child1 = body.FindChild("ui_uniticon");

            if (Object.op_Equality((Object)child1, (Object)null))
            {
                return;
            }
            Transform child2 = child1.FindChild("unit");

            if (Object.op_Equality((Object)child2, (Object)null))
            {
                return;
            }
            Transform child3 = child2.FindChild(nameof(job));

            if (Object.op_Equality((Object)child3, (Object)null))
            {
                return;
            }
            RawImage_Transparent component = (RawImage_Transparent)((Component)child3).GetComponent <RawImage_Transparent>();

            if (Object.op_Equality((Object)component, (Object)null))
            {
                return;
            }
            MonoSingleton <GameManager> .Instance.ApplyTextureAsync((RawImage)component, job == null?(string)null : AssetPath.JobIconSmall(job));
        }
예제 #12
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;
                }
            }
        }
예제 #13
0
        public void Setup(ConceptCardData conceptCardData)
        {
            try
            {
                UnitParam unitParam = MonoSingleton <GameManager> .Instance.GetUnitParam(conceptCardData.Param.first_get_unit);

                ConceptCardParam card = conceptCardData.Param;
                if (Object.op_Inequality((Object)this.m_ConceptCardImage, (Object)null) && card != null)
                {
                    MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.m_ConceptCardImage, AssetPath.ConceptCard(card));
                }
                if (Object.op_Inequality((Object)this.m_UnitImage, (Object)null) && unitParam != null)
                {
                    MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.m_UnitImage, AssetPath.UnitImage(unitParam, unitParam.GetJobId(0)));
                }
                if (Object.op_Inequality((Object)this.m_UnitBlurImage, (Object)null) && unitParam != null)
                {
                    MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.m_UnitBlurImage, AssetPath.UnitImage(unitParam, unitParam.GetJobId(0)));
                }
                if (Object.op_Inequality((Object)this.m_ConceptCardFrame, (Object)null))
                {
                    this.m_ConceptCardFrame.ImageIndex = card.rare;
                }
                if (Object.op_Inequality((Object)this.m_UnitTextDescription, (Object)null))
                {
                    this.m_UnitTextDescription.set_text(LocalizedText.Get("sys.CONCEPT_CARD_UNIT_GET_DESCRIPTION", (object)card.name, (object)unitParam.name));
                }
                this.SetConceptCardRarity(card.rare + 1);
                this.SetUnitRarity((int)unitParam.rare + 1);
                this.m_UnitRarity = (int)unitParam.rare;
                this.StartCoroutine(this.WaitConceptCardEffectEnd());
            }
            catch
            {
                this.SetConceptCardRarity(1);
                this.SetUnitRarity(1);
            }
        }
예제 #14
0
 public void Refresh()
 {
     if (this.m_Present == null)
     {
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_TimeLimitObject, (UnityEngine.Object)null))
         {
             this.m_TimeLimitObject.SetActive(false);
         }
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_NameObject, (UnityEngine.Object)null))
         {
             this.m_NameObject.SetActive(false);
         }
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_IconObject, (UnityEngine.Object)null))
         {
             this.m_IconObject.SetActive(false);
         }
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_CoinIconObject, (UnityEngine.Object)null))
         {
             this.m_CoinIconObject.SetActive(false);
         }
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_NumObject, (UnityEngine.Object)null))
         {
             this.m_NumObject.SetActive(false);
         }
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_SettingTextObject, (UnityEngine.Object)null))
         {
             this.m_SettingTextObject.SetActive(true);
         }
         if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_FrameObject, (UnityEngine.Object)null))
         {
             return;
         }
         this.SetSprite(this.m_FrameObject, GameSettings.Instance.GetItemFrame(EItemType.Other, 0), Color.get_gray());
     }
     else
     {
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_SettingTextObject, (UnityEngine.Object)null))
         {
             this.m_SettingTextObject.SetActive(false);
         }
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_TimeLimitObject, (UnityEngine.Object)null))
         {
             this.m_TimeLimitObject.SetActive(this.m_Present.HasTimeLimit());
         }
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_TimeLimitValueObject, (UnityEngine.Object)null))
         {
             this.SetRestTime(this.m_TimeLimitValueObject, this.m_Present.end_at);
         }
         if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_NameObject, (UnityEngine.Object)null))
         {
             this.SetText(this.m_NameObject, this.m_Present.name);
         }
         if (this.m_ItemData != null)
         {
             if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_FrameObject, (UnityEngine.Object)null))
             {
                 this.SetSprite(this.m_FrameObject, GameSettings.Instance.GetItemFrame(this.m_Present.item), Color.get_white());
             }
             if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_IconObject, (UnityEngine.Object)null))
             {
                 this.m_IconObject.SetActive(true);
                 GameUtility.RequireComponent <IconLoader>(this.m_IconObject).ResourcePath = AssetPath.ItemIcon(this.m_ItemData.Param);
             }
             if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_CoinIconObject, (UnityEngine.Object)null))
             {
                 this.m_CoinIconObject.SetActive(false);
             }
             if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_AmountObject, (UnityEngine.Object)null))
             {
                 this.SetText(this.m_AmountObject, this.m_Present.num);
             }
             if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_NumObject, (UnityEngine.Object)null))
             {
                 this.m_NumObject.SetActive(true);
             }
             if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_NumValueObject, (UnityEngine.Object)null))
             {
                 return;
             }
             this.m_NumValueObject.SetActive(true);
             this.SetText(this.m_NumValueObject, this.m_ItemData.Num);
         }
         else
         {
             if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_FrameObject, (UnityEngine.Object)null))
             {
                 this.SetSprite(this.m_FrameObject, GameSettings.Instance.GetItemFrame(EItemType.Other, 0), Color.get_white());
             }
             if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_IconObject, (UnityEngine.Object)null))
             {
                 this.m_IconObject.SetActive(false);
             }
             if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_CoinIconObject, (UnityEngine.Object)null))
             {
                 this.m_CoinIconObject.SetActive(true);
             }
             if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_ZenyObject, (UnityEngine.Object)null))
             {
                 this.SetText(this.m_ZenyObject, this.m_Present.zeny);
             }
             if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_NumObject, (UnityEngine.Object)null))
             {
                 return;
             }
             this.m_NumObject.SetActive(false);
         }
     }
 }
예제 #15
0
        public override void UpdateValue()
        {
            GameSettings instance     = GameSettings.Instance;
            UnitData     instanceData = this.GetInstanceData();

            if (Object.op_Inequality((Object)this.Icon, (Object)null))
            {
                MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, instanceData == null?(string)null : AssetPath.UnitSkinIconSmall(instanceData.UnitParam, instanceData.GetSelectedSkin(-1), instanceData.CurrentJobId));
            }
            if (Object.op_Inequality((Object)this.LvParent, (Object)null))
            {
                this.LvParent.SetActive(this.mIsLvActive);
            }
            if (Object.op_Inequality((Object)this.Level, (Object)null))
            {
                if (instanceData != null)
                {
                    this.Level.set_text(instanceData.Lv.ToString());
                    ((Component)this.Level).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.Level).get_gameObject().SetActive(false);
                }
            }
            if (Object.op_Inequality((Object)this.Rarity, (Object)null) && Object.op_Inequality((Object)instance, (Object)null) && instance.UnitIcon_Rarity.Length > 0)
            {
                if (instanceData != null)
                {
                    int index = 0;
                    if (instanceData.CurrentJob != null)
                    {
                        index = Mathf.Clamp(instanceData.Rarity, 0, instance.UnitIcon_Rarity.Length - 1);
                    }
                    this.Rarity.set_sprite(instance.UnitIcon_Rarity[index]);
                }
                else
                {
                    this.Rarity.set_sprite((Sprite)null);
                }
            }
            if (Object.op_Inequality((Object)this.Frame, (Object)null) && Object.op_Inequality((Object)instance, (Object)null) && instance.UnitIcon_Frames.Length > 0)
            {
                if (instanceData != null)
                {
                    int index = 0;
                    if (instanceData.CurrentJob != null)
                    {
                        index = Mathf.Clamp(instanceData.CurrentJob.Rank, 0, instance.UnitIcon_Frames.Length - 1);
                    }
                    this.Frame.set_sprite(instance.UnitIcon_Frames[index]);
                }
                else
                {
                    this.Frame.set_sprite((Sprite)null);
                }
            }
            if (Object.op_Inequality((Object)this.Element, (Object)null) && Object.op_Inequality((Object)instance, (Object)null))
            {
                if (instanceData != null && EElement.None <= instanceData.Element && instanceData.Element < (EElement)instance.Elements_IconSmall.Length)
                {
                    this.Element.set_sprite(instance.Elements_IconSmall[(int)instanceData.Element]);
                }
                else
                {
                    this.Element.set_sprite((Sprite)null);
                }
            }
            if (Object.op_Inequality((Object)this.Job, (Object)null))
            {
                JobParam job = (JobParam)null;
                if (instanceData != null && instanceData.CurrentJob != null)
                {
                    job = instanceData.CurrentJob.Param;
                }
                MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Job, job == null?(string)null : AssetPath.JobIconSmall(job));
            }
            if (!MonoSingleton <GameManager> .Instance.IsTutorial() || instanceData == null || (!(MonoSingleton <GameManager> .Instance.GetNextTutorialStep() == "ShowUnitList") || !(instanceData.UnitID == "UN_V2_LOGI")))
            {
                return;
            }
            SGHighlightObject.Instance().highlightedObject = ((Component)this).get_gameObject();
            SGHighlightObject.Instance().Highlight(string.Empty, "sg_tut_1.017", (SGHighlightObject.OnActivateCallback)null, EventDialogBubble.Anchors.BottomLeft, true, false, false);
        }
예제 #16
0
        public override void UpdateValue()
        {
            ArtifactData  data          = (ArtifactData)null;
            ArtifactParam artifactParam = (ArtifactParam)null;
            GameManager   instance1     = MonoSingleton <GameManager> .Instance;

            if (this.InstanceType == ArtifactIcon.InstanceTypes.ArtifactData)
            {
                data = DataSource.FindDataOfClass <ArtifactData>(((Component)this).get_gameObject(), (ArtifactData)null);
            }
            else
            {
                artifactParam = DataSource.FindDataOfClass <ArtifactParam>(((Component)this).get_gameObject(), (ArtifactParam)null);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Lv, (UnityEngine.Object)null))
            {
                if (data != null)
                {
                    if ((int)data.Lv != this.mLastLv)
                    {
                        this.mLastLv = (int)data.Lv;
                        this.Lv.set_text(data.Lv.ToString());
                    }
                    ((Component)this.Lv).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.Lv).get_gameObject().SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PreLvCap, (UnityEngine.Object)null))
            {
                if (data != null && (int)data.Rarity > 0)
                {
                    this.PreLvCap.set_text(MonoSingleton <GameManager> .Instance.GetRarityParam((int)data.Rarity - 1).ArtifactLvCap.ToString());
                    ((Component)this.PreLvCap).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.PreLvCap).get_gameObject().SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LvCap, (UnityEngine.Object)null))
            {
                if (data != null)
                {
                    if ((int)data.LvCap != this.mLastLvCap)
                    {
                        this.mLastLvCap = (int)data.LvCap;
                        this.LvCap.set_text(data.LvCap.ToString());
                    }
                    ((Component)this.LvCap).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.LvCap).get_gameObject().SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LvGauge, (UnityEngine.Object)null))
            {
                if (data != null)
                {
                    if (data.Exp != this.mLastExpNum)
                    {
                        this.LvGauge.set_minValue(1f);
                        this.LvGauge.set_maxValue((float)(int)data.LvCap);
                        this.LvGauge.set_value((float)(int)data.Lv);
                    }
                    ((Component)this.LvGauge).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.LvGauge).get_gameObject().SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ExpGauge, (UnityEngine.Object)null))
            {
                if (data != null)
                {
                    if (data.Exp != this.mLastExpNum)
                    {
                        if ((int)data.Lv >= (int)data.LvCap)
                        {
                            this.ExpGauge.set_minValue(0.0f);
                            Slider expGauge = this.ExpGauge;
                            float  num1     = 1f;
                            this.ExpGauge.set_value(num1);
                            double num2 = (double)num1;
                            expGauge.set_maxValue((float)num2);
                        }
                        else
                        {
                            int showExp = data.GetShowExp();
                            int nextExp = data.GetNextExp();
                            this.ExpGauge.set_minValue(0.0f);
                            this.ExpGauge.set_maxValue((float)(showExp + nextExp));
                            this.ExpGauge.set_value((float)showExp);
                        }
                    }
                    ((Component)this.ExpGauge).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.ExpGauge).get_gameObject().SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PieceGauge, (UnityEngine.Object)null))
            {
                if (artifactParam != null)
                {
                    this.PieceGauge.set_minValue(0.0f);
                    ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(artifactParam.kakera);

                    this.PieceGauge.set_maxValue((float)(int)MonoSingleton <GameManager> .Instance.GetRarityParam(artifactParam.rareini).ArtifactCreatePieceNum);
                    this.PieceGauge.set_value(itemDataByItemId == null ? 0.0f : (float)itemDataByItemId.Num);
                    ((Component)this.PieceGauge).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.PieceGauge).get_gameObject().SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Icon, (UnityEngine.Object)null))
            {
                if (data != null || artifactParam != null)
                {
                    string path = AssetPath.ArtifactIcon(data == null ? artifactParam : data.ArtifactParam);
                    instance1.ApplyTextureAsync(this.Icon, path);
                }
                else
                {
                    instance1.CancelTextureLoadRequest(this.Icon);
                    this.Icon.set_texture((Texture)null);
                }
            }
            int index1 = 0;
            int index2 = 0;

            if (data != null)
            {
                index1 = (int)data.Rarity;
                index2 = (int)data.RarityCap;
            }
            else if (artifactParam != null)
            {
                index1 = artifactParam.rareini;
                index2 = artifactParam.raremax;
            }
            if (data != null || artifactParam != null)
            {
                bool flag1 = data != null && data.CheckEnableRarityUp() == ArtifactData.RarityUpResults.Success;
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityUp, (UnityEngine.Object)null))
                {
                    this.RarityUp.SetActive(flag1);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityUpBack, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DefaultBack, (UnityEngine.Object)null))
                {
                    ((Behaviour)this.RarityUpBack).set_enabled(flag1);
                    ((Behaviour)this.DefaultBack).set_enabled(!flag1);
                }
                bool flag2 = false;
                if (artifactParam != null)
                {
                    ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(artifactParam.kakera);

                    if (itemDataByItemId != null)
                    {
                        RarityParam rarityParam = MonoSingleton <GameManager> .Instance.GetRarityParam(artifactParam.rareini);

                        flag2 = itemDataByItemId.Num >= (int)rarityParam.ArtifactCreatePieceNum;
                    }
                    else
                    {
                        flag2 = false;
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CanCreate, (UnityEngine.Object)null))
                {
                    this.CanCreate.SetActive(flag2);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CanCreateBack, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DefaultBack, (UnityEngine.Object)null))
                {
                    ((Behaviour)this.CanCreateBack).set_enabled(flag2);
                    ((Behaviour)this.DefaultBack).set_enabled(!flag2);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CanCreateGauge, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DefaultBack, (UnityEngine.Object)null))
                {
                    ((Behaviour)this.CanCreateGauge).set_enabled(flag2);
                    ((Behaviour)this.DefaultBack).set_enabled(!flag2);
                }
                if (this.NotCreateGrayIcon != null && this.NotCreateGrayIcon.Length > 0)
                {
                    if (flag2)
                    {
                        for (int index3 = 0; index3 < this.NotCreateGrayIcon.Length; ++index3)
                        {
                            ((Graphic)this.NotCreateGrayIcon[index3]).set_color(Color.get_white());
                        }
                    }
                    else
                    {
                        for (int index3 = 0; index3 < this.NotCreateGrayIcon.Length; ++index3)
                        {
                            ((Graphic)this.NotCreateGrayIcon[index3]).set_color(Color.get_cyan());
                        }
                    }
                }
                if (this.NotCreateGrayRawIcon != null && this.NotCreateGrayRawIcon.Length > 0)
                {
                    if (flag2)
                    {
                        for (int index3 = 0; index3 < this.NotCreateGrayRawIcon.Length; ++index3)
                        {
                            ((Graphic)this.NotCreateGrayRawIcon[index3]).set_color(Color.get_white());
                        }
                    }
                    else
                    {
                        for (int index3 = 0; index3 < this.NotCreateGrayRawIcon.Length; ++index3)
                        {
                            ((Graphic)this.NotCreateGrayRawIcon[index3]).set_color(Color.get_cyan());
                        }
                    }
                }
                if (data != null && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.NotRarityUp, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CanRarityUp, (UnityEngine.Object)null))
                {
                    bool flag3 = (int)data.Rarity == (int)data.RarityCap;
                    this.NotRarityUp.SetActive(flag3);
                    this.CanRarityUp.SetActive(!flag3);
                }
                if (data != null && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityUpCost, (UnityEngine.Object)null))
                {
                    this.RarityUpCost.set_text(data.GetKakeraNeedNum().ToString());
                }
                if (artifactParam != null && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TransmuteCost, (UnityEngine.Object)null))
                {
                    this.TransmuteCost.set_text((int)MonoSingleton <GameManager> .Instance.GetRarityParam(artifactParam.rareini).ArtifactCreatePieceNum.ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PieceNum, (UnityEngine.Object)null))
                {
                    ItemData itemData = data == null ? MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(artifactParam.kakera) : MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemParam(data.Kakera);

                    if (itemData != null)
                    {
                        this.PieceNum.set_text(itemData.Num.ToString());
                        if (data != null && data.CheckEnableRarityUp() == ArtifactData.RarityUpResults.Success)
                        {
                            ((Graphic)this.PieceNum).set_color(Color.get_yellow());
                        }
                        else
                        {
                            ((Graphic)this.PieceNum).set_color(Color.get_white());
                        }
                    }
                    else
                    {
                        this.PieceNum.set_text("0");
                        ((Graphic)this.PieceNum).set_color(Color.get_white());
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Rarity, (UnityEngine.Object)null))
                {
                    GameSettings instance2 = GameSettings.Instance;
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance2, (UnityEngine.Object)null) && index1 < instance2.ArtifactIcon_Rarity.Length)
                    {
                        this.Rarity.set_sprite(instance2.ArtifactIcon_Rarity[index1]);
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityMax, (UnityEngine.Object)null))
                {
                    GameSettings instance2 = GameSettings.Instance;
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance2, (UnityEngine.Object)null) && index2 < instance2.ArtifactIcon_RarityBG.Length)
                    {
                        this.RarityMax.set_sprite(instance2.ArtifactIcon_RarityBG[index2]);
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityText, (UnityEngine.Object)null))
                {
                    this.RarityText.set_text((index1 + 1).ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityMaxText, (UnityEngine.Object)null))
                {
                    this.RarityMaxText.set_text((index2 + 1).ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Frame, (UnityEngine.Object)null))
                {
                    GameSettings instance2 = GameSettings.Instance;
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance2, (UnityEngine.Object)null) && index1 < instance2.ArtifactIcon_Frames.Length)
                    {
                        this.Frame.set_sprite(instance2.ArtifactIcon_Frames[index1]);
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Category, (UnityEngine.Object)null))
                {
                    GameSettings instance2 = GameSettings.Instance;
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance2, (UnityEngine.Object)null) && (data != null || artifactParam != null))
                    {
                        switch (data == null ? (int)artifactParam.type : (int)data.ArtifactParam.type)
                        {
                        case 1:
                            this.Category.set_sprite(instance2.ArtifactIcon_Weapon);
                            break;

                        case 2:
                            this.Category.set_sprite(instance2.ArtifactIcon_Armor);
                            break;

                        case 3:
                            this.Category.set_sprite(instance2.ArtifactIcon_Misc);
                            break;
                        }
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DecKakeraNum, (UnityEngine.Object)null))
                {
                    this.DecKakeraNum.set_text(data.GetKakeraChangeNum().ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DecCost, (UnityEngine.Object)null))
                {
                    this.DecCost.set_text(data.RarityParam.ArtifactChangeCost.ToString());
                }
            }
            else
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Rarity, (UnityEngine.Object)null))
                {
                    this.Rarity.set_sprite((Sprite)null);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RarityMax, (UnityEngine.Object)null))
                {
                    this.RarityMax.set_sprite((Sprite)null);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Frame, (UnityEngine.Object)null))
                {
                    this.Frame.set_sprite((Sprite)null);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Category, (UnityEngine.Object)null))
                {
                    this.Category.set_sprite((Sprite)null);
                }
            }
            bool flag = false;

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Owner, (UnityEngine.Object)null))
            {
                if (data != null && this.SetOwnerIcon(instance1, data))
                {
                    this.Owner.SetActive(true);
                    flag = true;
                }
                else
                {
                    this.Owner.SetActive(false);
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Favorite, (UnityEngine.Object)null))
            {
                if (data != null && data.IsFavorite)
                {
                    this.Favorite.SetActive(true);
                    flag = true;
                }
                else
                {
                    this.Favorite.SetActive(false);
                }
            }
            if (this.ForceMask)
            {
                flag = true;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LockMask, (UnityEngine.Object)null))
            {
                this.LockMask.SetActive(flag);
            }
            if (data == null)
            {
                return;
            }
            this.mLastExpNum = data.Exp;
        }
예제 #17
0
        public void Refresh(ChatLogParam param, ChatWindow.MessageTemplateType type)
        {
            if (param == null)
            {
                return;
            }
            if (this.mCoroutine != null)
            {
                this.StopCoroutine(this.mCoroutine);
                this.mCoroutine = (Coroutine)null;
            }
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.mRoot, (UnityEngine.Object)null))
            {
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)((Component)this).get_transform().get_parent(), (UnityEngine.Object)null))
                {
                    return;
                }
                this.mRoot = ((Component)((Component)this).get_transform().get_parent()).get_gameObject();
            }
            this.MessageIcon.SetActive(false);
            this.MessageLog.SetActive(false);
            this.MyMessageIcon.SetActive(false);
            this.MyMessageLog.SetActive(false);
            this.SystemMessageRootObj.SetActive(false);
            switch (type)
            {
            case ChatWindow.MessageTemplateType.OtherUser:
                this.MessageIcon.SetActive(true);
                this.MessageLog.SetActive(true);
                this.mStampRoot     = !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AnyStampObj, (UnityEngine.Object)null) ? (Transform)null : this.AnyStampObj.get_transform();
                this.mNameObj       = this.AnyNameObj;
                this.mFuIDObj       = this.AnyFuIDObj;
                this.mPostAtObj     = this.AnyPostAtObj;
                this.mStampImageObj = this.AnyStampImageObj;
                this.mMessageObj    = this.AnyMessageTextObj;
                this.mLogRoot       = this.AnyLogRoot;
                this.mLogImg        = (Image)((Component)this.AnyLogRoot).GetComponent <Image>();
                break;

            case ChatWindow.MessageTemplateType.User:
                this.MyMessageIcon.SetActive(true);
                this.MyMessageLog.SetActive(true);
                this.mStampRoot     = !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.MyStampObj, (UnityEngine.Object)null) ? (Transform)null : this.MyStampObj.get_transform();
                this.mNameObj       = this.MyNameObj;
                this.mFuIDObj       = this.MyFuIDObj;
                this.mPostAtObj     = this.MyPostAtObj;
                this.mStampImageObj = this.MyStampImageObj;
                this.mMessageObj    = this.MyMessageTextObj;
                this.mLogRoot       = this.MyLogRoot;
                this.mLogImg        = (Image)((Component)this.MyLogRoot).GetComponent <Image>();
                break;

            case ChatWindow.MessageTemplateType.System:
                this.SystemMessageRootObj.SetActive(true);
                this.SystemMessageTextObj.set_text(param.message);
                this.mCoroutine = this.StartCoroutine(this.RefreshTextLine(param.message));
                return;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Icon, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LeftIcon, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RightIcon, (UnityEngine.Object)null))
            {
                RawImage  target    = type != ChatWindow.MessageTemplateType.User ? this.LeftIcon : this.RightIcon;
                UnitParam unitParam = MonoSingleton <GameManager> .Instance.MasterParam.GetUnitParam(param.icon);

                if (unitParam != null)
                {
                    if (!string.IsNullOrEmpty(param.skin_iname) && UnityEngine.Object.op_Inequality((UnityEngine.Object)target, (UnityEngine.Object)null))
                    {
                        ArtifactParam skin = Array.Find <ArtifactParam>(MonoSingleton <GameManager> .Instance.MasterParam.Artifacts.ToArray(), (Predicate <ArtifactParam>)(p => p.iname == param.skin_iname));
                        MonoSingleton <GameManager> .Instance.ApplyTextureAsync(target, AssetPath.UnitSkinIconSmall(unitParam, skin, param.job_iname));
                    }
                    else
                    {
                        MonoSingleton <GameManager> .Instance.ApplyTextureAsync(target, AssetPath.UnitIconSmall(unitParam, param.job_iname));
                    }
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mNameObj, (UnityEngine.Object)null))
            {
                this.mNameObj.set_text(param.name);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mFuIDObj, (UnityEngine.Object)null))
            {
                this.mFuIDObj.set_text(LocalizedText.Get("sys.TEXT_CHAT_FUID", new object[1]
                {
                    (object)param.fuid.Substring(param.fuid.Length - 4, 4)
                }));
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mPostAtObj, (UnityEngine.Object)null))
            {
                this.mPostAtObj.set_text(ChatLogItem.GetPostAt(param.posted_at));
            }
            if ((int)param.message_type == 1)
            {
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mRoot, (UnityEngine.Object)null) || !this.mRoot.get_activeInHierarchy())
                {
                    return;
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mStampRoot, (UnityEngine.Object)null))
                {
                    ((Component)this.mStampRoot).get_gameObject().SetActive(false);
                }
                this.mCoroutine = this.StartCoroutine(this.RefreshTextLine(param.message));
            }
            else
            {
                if ((int)param.message_type != 2 || !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mRoot, (UnityEngine.Object)null) || !this.mRoot.get_activeInHierarchy())
                {
                    return;
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mStampRoot, (UnityEngine.Object)null))
                {
                    ((Component)this.mStampRoot).get_gameObject().SetActive(true);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Element, (UnityEngine.Object)null))
                {
                    int stampSize = this.STAMP_SIZE;
                    VerticalLayoutGroup component = (VerticalLayoutGroup)((Component)this.mLogRoot).GetComponent <VerticalLayoutGroup>();
                    this.Element.set_minHeight((float)(stampSize + ((LayoutGroup)component).get_padding().get_top() + ((LayoutGroup)component).get_padding().get_bottom() + (int)Mathf.Abs((float)this.mLogRoot.get_anchoredPosition().y)));
                }
                ((Behaviour)this.mLogImg).set_enabled(false);
                this.mCoroutine = this.StartCoroutine(this.RefreshStamp(param.stamp_id));
            }
        }
예제 #18
0
        public override void Refresh()
        {
            if (this.mConceptCardData == null)
            {
                return;
            }
            string firstGetUnit = this.mConceptCardData.Param.first_get_unit;

            if (string.IsNullOrEmpty(firstGetUnit))
            {
                return;
            }
            UnitParam unitParam = this.GM.GetUnitParam(firstGetUnit);

            if (unitParam == null)
            {
                return;
            }
            if (Object.op_Inequality((Object)this.UnitIcon, (Object)null))
            {
                MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.UnitIcon, unitParam == null?(string)null : AssetPath.UnitSkinIconSmall(unitParam, (ArtifactParam)null, (string)null));
            }
            if (Object.op_Inequality((Object)this.UnitName, (Object)null))
            {
                this.UnitName.set_text(unitParam.name);
            }
            if (!Object.op_Inequality((Object)this.UnitDetailBtn, (Object)null))
            {
                return;
            }
            ButtonEvent.Event @event = this.UnitDetailBtn.GetEvent("CONCEPT_CARD_DETAIL_BTN_UNIT_DETAIL");
            if (@event == null)
            {
                return;
            }
            @event.valueList.SetField("select_unit", unitParam.iname);
        }
예제 #19
0
        public bool Initialize(BattleCore core, MapParam param)
        {
            this.mBattle         = core;
            this.MapSceneName    = param.mapSceneName;
            this.BattleSceneName = param.battleSceneName;
            this.EventSceneName  = param.eventSceneName;
            this.BGMName         = param.bgmName;
            this.mWinMonitorCondition.Clear();
            this.mLoseMonitorCondition.Clear();
            if (string.IsNullOrEmpty(param.mapSceneName))
            {
                DebugUtility.LogError("not found mapdata.");
                return(false);
            }
            string path1 = AssetPath.LocalMap(param.mapSceneName);
            string src1  = AssetManager.LoadTextData(path1);

            if (src1 == null)
            {
                DebugUtility.LogError("Failed to load " + path1);
                return(false);
            }
            if (!this.Deserialize(JSONParser.parseJSONObject <JSON_Map>(src1)))
            {
                DebugUtility.LogError("Failed to load " + path1);
                return(false);
            }
            string path2 = AssetPath.LocalMap(param.mapSetName);
            string src2  = AssetManager.LoadTextData(path2);

            if (src2 == null)
            {
                DebugUtility.LogError("マップ配置情報\"" + path2 + "\"に存在しない");
                return(false);
            }
            JSON_MapUnit jsonObject = JSONParser.parseJSONObject <JSON_MapUnit>(src2);

            if (jsonObject == null)
            {
                DebugUtility.LogError("マップ配置情報\"" + path2 + "\"のパースに失敗");
                return(false);
            }
            if (jsonObject.enemy == null && jsonObject.arena == null)
            {
                DebugUtility.LogError("敵ユニットの配置情報がマップ配置情報\"" + path2 + "\"に存在しない");
                return(false);
            }
            if (jsonObject.party != null)
            {
                this.mPartyUnitSettings = new List <UnitSetting>(jsonObject.party.Length);
                for (int index = 0; index < jsonObject.party.Length; ++index)
                {
                    this.mPartyUnitSettings.Add(new UnitSetting(jsonObject.party[index]));
                }
            }
            if (jsonObject.party_subs != null && jsonObject.party_subs.Length != 0)
            {
                this.mPartyUnitSubSettings = new List <UnitSubSetting>(jsonObject.party_subs.Length);
                foreach (JSON_MapPartySubCT partySub in jsonObject.party_subs)
                {
                    this.mPartyUnitSubSettings.Add(new UnitSubSetting(partySub));
                }
            }
            if (jsonObject.tricks != null && jsonObject.tricks.Length != 0)
            {
                this.mTrickSettings = new List <TrickSetting>(jsonObject.tricks.Length);
                foreach (JSON_MapTrick trick in jsonObject.tricks)
                {
                    this.mTrickSettings.Add(new TrickSetting(trick));
                }
            }
            if (jsonObject.enemy != null)
            {
                jsonObject.enemy      = jsonObject.ReplacedRandEnemy(this.mRandDeckResult, true);
                this.mNPCUnitSettings = new List <NPCSetting>(jsonObject.enemy.Length);
                for (int index = 0; index < jsonObject.enemy.Length; ++index)
                {
                    this.mNPCUnitSettings.Add(new NPCSetting(jsonObject.enemy[index]));
                }
            }
            if (jsonObject.arena != null)
            {
                this.mArenaUnitSettings = new List <UnitSetting>(jsonObject.arena.Length);
                for (int index = 0; index < jsonObject.arena.Length; ++index)
                {
                    UnitSetting unitSetting = new UnitSetting();
                    unitSetting.uniqname          = (OString)jsonObject.arena[index].name;
                    unitSetting.ai                = (OString)jsonObject.arena[index].ai;
                    unitSetting.pos.x             = (OInt)jsonObject.arena[index].x;
                    unitSetting.pos.y             = (OInt)jsonObject.arena[index].y;
                    unitSetting.dir               = (OInt)jsonObject.arena[index].dir;
                    unitSetting.waitEntryClock    = (OInt)jsonObject.arena[index].wait_e;
                    unitSetting.waitMoveTurn      = (OInt)jsonObject.arena[index].wait_m;
                    unitSetting.waitExitTurn      = (OInt)jsonObject.arena[index].wait_exit;
                    unitSetting.startCtCalc       = (eMapUnitCtCalcType)jsonObject.arena[index].ct_calc;
                    unitSetting.startCtVal        = (OInt)jsonObject.arena[index].ct_val;
                    unitSetting.DisableFirceVoice = jsonObject.arena[index].fvoff != 0;
                    unitSetting.side              = (OInt)1;
                    unitSetting.ai_pos.x          = (OInt)jsonObject.arena[index].ai_x;
                    unitSetting.ai_pos.y          = (OInt)jsonObject.arena[index].ai_y;
                    unitSetting.ai_len            = (OInt)jsonObject.arena[index].ai_len;
                    unitSetting.parent            = (OString)jsonObject.arena[index].parent;
                    if (jsonObject.arena[index].trg != null)
                    {
                        unitSetting.trigger = new EventTrigger();
                        unitSetting.trigger.Deserialize(jsonObject.arena[index].trg);
                    }
                    this.mArenaUnitSettings.Add(unitSetting);
                }
            }
            if (jsonObject.w_cond != null)
            {
                jsonObject.w_cond.CopyTo(this.mWinMonitorCondition);
            }
            if (jsonObject.l_cond != null)
            {
                jsonObject.l_cond.CopyTo(this.mLoseMonitorCondition);
            }
            if (jsonObject.gs != null)
            {
                this.mGimmickEvents = new List <JSON_GimmickEvent>((IEnumerable <JSON_GimmickEvent>)jsonObject.gs);
            }
            return(true);
        }
예제 #20
0
        private void Start()
        {
            if (Object.op_Equality((Object)ConceptCardManager.Instance, (Object)null))
            {
                return;
            }
            ConceptCardManager instance        = ConceptCardManager.Instance;
            ConceptCardData    conceptCardData = instance.SelectedConceptCardMaterialData == null ? instance.SelectedConceptCardData : instance.SelectedConceptCardMaterialData;

            if (!Object.op_Inequality((Object)this.Image, (Object)null))
            {
                return;
            }
            MonoSingleton <GameManager> .Instance.ApplyTextureAsync((RawImage)this.Image, AssetPath.ConceptCard(conceptCardData.Param));
        }
예제 #21
0
        public override void UpdateValue()
        {
            GameSettings instance     = GameSettings.Instance;
            UnitData     instanceData = this.GetInstanceData();

            if (Object.op_Inequality((Object)this.Icon, (Object)null))
            {
                MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, instanceData == null?(string)null : AssetPath.UnitSkinIconSmall(instanceData.UnitParam, instanceData.GetSelectedSkin(-1), instanceData.CurrentJobId));
            }
            if (Object.op_Inequality((Object)this.Level, (Object)null))
            {
                if (instanceData != null)
                {
                    this.Level.set_text(instanceData.Lv.ToString());
                    ((Component)this.Level).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.Level).get_gameObject().SetActive(false);
                }
            }
            if (Object.op_Inequality((Object)this.Rarity, (Object)null) && Object.op_Inequality((Object)instance, (Object)null) && instance.UnitIcon_Rarity.Length > 0)
            {
                if (instanceData != null)
                {
                    int index = 0;
                    if (instanceData.CurrentJob != null)
                    {
                        index = Mathf.Clamp(instanceData.Rarity, 0, instance.UnitIcon_Rarity.Length - 1);
                    }
                    this.Rarity.set_sprite(instance.UnitIcon_Rarity[index]);
                }
                else
                {
                    this.Rarity.set_sprite((Sprite)null);
                }
            }
            if (Object.op_Inequality((Object)this.Frame, (Object)null) && Object.op_Inequality((Object)instance, (Object)null) && instance.UnitIcon_Frames.Length > 0)
            {
                if (instanceData != null)
                {
                    int index = 0;
                    if (instanceData.CurrentJob != null)
                    {
                        index = Mathf.Clamp(instanceData.CurrentJob.Rank, 0, instance.UnitIcon_Frames.Length - 1);
                    }
                    this.Frame.set_sprite(instance.UnitIcon_Frames[index]);
                }
                else
                {
                    this.Frame.set_sprite((Sprite)null);
                }
            }
            if (Object.op_Inequality((Object)this.Element, (Object)null) && Object.op_Inequality((Object)instance, (Object)null))
            {
                if (instanceData != null && EElement.None <= instanceData.Element && instanceData.Element < (EElement)instance.Elements_IconSmall.Length)
                {
                    this.Element.set_sprite(instance.Elements_IconSmall[(int)instanceData.Element]);
                }
                else
                {
                    this.Element.set_sprite((Sprite)null);
                }
            }
            if (!Object.op_Inequality((Object)this.Job, (Object)null))
            {
                return;
            }
            JobParam job = (JobParam)null;

            if (instanceData != null && instanceData.CurrentJob != null)
            {
                job = instanceData.CurrentJob.Param;
            }
            MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Job, job == null?(string)null : AssetPath.JobIconSmall(job));
        }
예제 #22
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);
        }
예제 #23
0
        public override void UpdateValue()
        {
            ItemParam itemParam;
            int       itemNum;

            this.InstanceType.GetInstanceData(this.InstanceIndex, ((Component)this).get_gameObject(), out itemParam, out itemNum);
            if (itemParam == null)
            {
                return;
            }
            this.mSecretItemParam = itemParam;
            if (Object.op_Inequality((Object)this.Icon, (Object)null))
            {
                if (this.IsSecret)
                {
                    MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, AssetPath.ItemIcon("IT_UNKNOWN"));

                    if (Object.op_Implicit((Object)this.SecretAmount))
                    {
                        this.SecretAmount.SetActive(false);
                    }
                    if (Object.op_Implicit((Object)this.SecretBadge))
                    {
                        ((Behaviour)this.SecretBadge).set_enabled(false);
                    }
                }
                else
                {
                    MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, AssetPath.ItemIcon(itemParam));
                }
            }
            if (Object.op_Inequality((Object)this.Frame, (Object)null))
            {
                if (this.IsSecret)
                {
                    if (GameSettings.Instance.ItemIcons.NormalFrames != null && GameSettings.Instance.ItemIcons.NormalFrames.Length != 0)
                    {
                        this.Frame.set_sprite(GameSettings.Instance.ItemIcons.NormalFrames[0]);
                    }
                }
                else
                {
                    this.Frame.set_sprite(GameSettings.Instance.GetItemFrame(itemParam));
                }
            }
            if (Object.op_Inequality((Object)this.Num, (Object)null))
            {
                this.Num.set_text(itemNum.ToString());
            }
            if (Object.op_Inequality((Object)this.NumSlider, (Object)null))
            {
                this.NumSlider.set_value((float)itemNum / (float)itemParam.cap);
            }
            if (!Object.op_Inequality((Object)this.HaveNum, (Object)null))
            {
                return;
            }
            int num = -1;

            if (itemParam.iname == "$COIN")
            {
                num = MonoSingleton <GameManager> .Instance.Player.Coin;
            }
            else
            {
                ItemData itemDataByItemParam = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemParam(itemParam);

                if (itemDataByItemParam != null)
                {
                    num = itemDataByItemParam.Num;
                }
            }
            if (num < 0)
            {
                return;
            }
            this.HaveNum.set_text(LocalizedText.Get("sys.QUESTRESULT_REWARD_ITEM_HAVE", new object[1]
            {
                (object)num
            }));
        }