Ejemplo n.º 1
0
    protected void SetSouls(string path, List <UITexture> list, GameWebAPI.RespDataCM_LoginBonus.LoginReward[] rewardList)
    {
        int    num  = 1;
        string name = path + num;

        if (base.transform.Find(name) == null)
        {
            return;
        }
        UITexture component = base.transform.Find(name).GetComponent <UITexture>();

        while (component != null)
        {
            list.Add(component);
            if (rewardList.Length < num)
            {
                component.gameObject.SetActive(false);
            }
            else
            {
                int    num2            = num - 1;
                string rewardIcon      = this.GetRewardIcon(rewardList[num2]);
                string assetCategoryId = rewardList[num2].assetCategoryId;
                if (string.IsNullOrEmpty(assetCategoryId) || string.IsNullOrEmpty(rewardIcon) || !this.textureCategoryList.Contains(assetCategoryId.ToInt32()))
                {
                    component.gameObject.SetActive(false);
                }
                else
                {
                    NGUIUtil.ChangeUITextureFromFile(component, rewardIcon, false);
                }
            }
            num++;
            name = path + num;
            if (!(base.transform.Find(name) != null))
            {
                break;
            }
            component = base.transform.Find(name).GetComponent <UITexture>();
        }
    }
Ejemplo n.º 2
0
    private void ExchangeIconSet(GameWebAPI.RespDataMS_EventExchangeInfoLogic.Result.Detail exchangeInfo)
    {
        this.exchangeViewIcon.gameObject.SetActive(false);
        this.exchangeViewTexture.gameObject.SetActive(false);
        MasterDataMng.AssetCategory assetCategory = (MasterDataMng.AssetCategory) int.Parse(exchangeInfo.item.assetCategoryId);
        string text = string.Empty;

        switch (assetCategory)
        {
        case MasterDataMng.AssetCategory.MONSTER:
            text = string.Empty;
            break;

        case MasterDataMng.AssetCategory.DIGI_STONE:
            text = "Common02_Icon_Stone";
            this.exchangeViewIcon.gameObject.SetActive(true);
            break;

        case MasterDataMng.AssetCategory.LINK_POINT:
            text = "Common02_LB_Link";
            this.exchangeViewIcon.gameObject.SetActive(true);
            break;

        case MasterDataMng.AssetCategory.TIP:
            text = "Common02_LB_Chip";
            this.exchangeViewIcon.gameObject.SetActive(true);
            break;

        default:
            switch (assetCategory)
            {
            case MasterDataMng.AssetCategory.MEAT:
                text = "Common02_item_meat";
                this.exchangeViewIcon.gameObject.SetActive(true);
                goto IL_29E;

            case MasterDataMng.AssetCategory.SOUL:
            {
                this.exchangeViewTexture.gameObject.SetActive(true);
                string evolveItemIconPathByID = ClassSingleton <EvolutionData> .Instance.GetEvolveItemIconPathByID(exchangeInfo.item.assetValue);

                NGUIUtil.ChangeUITextureFromFile(this.exchangeViewTexture, evolveItemIconPathByID, false);
                goto IL_29E;
            }

            case MasterDataMng.AssetCategory.FACILITY_KEY:
            {
                FacilityConditionM[] facilityCondition         = FarmDataManager.GetFacilityCondition(exchangeInfo.item.assetValue);
                FacilityConditionM   facilityConditionM        = facilityCondition.FirstOrDefault((FacilityConditionM x) => int.Parse(x.conditionType) == 1);
                FacilityM            facilityMasterByReleaseId = FarmDataManager.GetFacilityMasterByReleaseId(facilityConditionM.releaseId);
                this.exchangeViewTexture.gameObject.SetActive(true);
                NGUIUtil.ChangeUITextureFromFile(this.exchangeViewTexture, facilityMasterByReleaseId.GetIconPath(), false);
                goto IL_29E;
            }

            case MasterDataMng.AssetCategory.CHIP:
                goto IL_29E;

            case MasterDataMng.AssetCategory.DUNGEON_TICKET:
            {
                GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM dungeonTicketM = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => exchangeInfo.item.assetValue == x.dungeonTicketId);
                if (dungeonTicketM != null)
                {
                    global::Debug.Log(dungeonTicketM.img);
                    this.exchangeViewTexture.gameObject.SetActive(true);
                    NGUIUtil.ChangeUITextureFromFile(this.exchangeViewTexture, dungeonTicketM.img, false);
                    this.exchangeDetailName = dungeonTicketM.name;
                }
                goto IL_29E;
            }
            }
            text = string.Empty;
            this.exchangeDetailName = StringMaster.GetString("Present-10");
            break;

        case MasterDataMng.AssetCategory.ITEM:
        {
            GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(exchangeInfo.item.assetValue);
            if (itemM != null)
            {
                this.exchangeViewTexture.gameObject.SetActive(true);
                string largeImagePath = itemM.GetLargeImagePath();
                NGUIUtil.ChangeUITextureFromFile(this.exchangeViewTexture, largeImagePath, false);
            }
            break;
        }
        }
IL_29E:
        if (!string.IsNullOrEmpty(text) && assetCategory != MasterDataMng.AssetCategory.MONSTER)
        {
            this.exchangeViewIcon.spriteName = text;
        }
    }
Ejemplo n.º 3
0
    public void SetDetail(GameWebAPI.RespDataMS_EventExchangeInfoLogic.Result.Detail exchangeInfo, int selectItemNum, Action <ExchangeItem> touchEvent)
    {
        this.onPushedButton = touchEvent;
        GUICollider component = this.pushedButton.GetComponent <GUICollider>();

        component.onTouchEnded += delegate(Touch touch, Vector2 pos, bool flag)
        {
            this.onPushedButton(this);
        };
        this.selectNum = selectItemNum;
        int.TryParse(exchangeInfo.eventExchangeDetailId, out this.exchangeDetailId);
        this.exchangeItemData = exchangeInfo.item;
        string text  = string.Empty;
        string value = string.Empty;

        this.exchangeInfoData = exchangeInfo;
        this.viewIcon.gameObject.SetActive(true);
        this.viewIconTexture.gameObject.SetActive(false);
        GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(exchangeInfo.assetCategoryId);
        string text2 = string.Empty;

        if (assetCategory != null)
        {
            text2 = assetCategory.assetTitle;
        }
        this.exchangeDetailCategoryID = exchangeInfo.assetCategoryId;
        MasterDataMng.AssetCategory assetCategory2 = (MasterDataMng.AssetCategory) int.Parse(exchangeInfo.assetCategoryId);
        this.numCountLabel.text = "1";
        switch (assetCategory2)
        {
        case MasterDataMng.AssetCategory.MONSTER:
        {
            text = string.Empty;
            if (this.micon != null)
            {
                UnityEngine.Object.Destroy(this.micon.gameObject);
            }
            this.viewIcon.gameObject.SetActive(false);
            MonsterData monsterData = MonsterDataMng.Instance().CreateMonsterDataByMID(exchangeInfo.assetValue);
            this.exchangeDetailName = monsterData.monsterMG.monsterName;
            this.micon = GUIMonsterIcon.MakePrefabByMonsterData(monsterData, new Vector3(1f, 1f, 1f), new Vector3(-165f, 25f, 0f), this.iconRoot.transform, true, false);
            UIWidget component2 = base.gameObject.GetComponent <UIWidget>();
            if (component2 != null)
            {
                DepthController component3 = this.micon.GetComponent <DepthController>();
                if (component3 != null)
                {
                    component3.AddWidgetDepth(this.micon.transform, component2.depth + 10);
                }
            }
            this.micon.GetDepthController();
            BoxCollider component4 = this.micon.gameObject.GetComponent <BoxCollider>();
            if (component4 != null)
            {
                component4.enabled = false;
            }
            break;
        }

        case MasterDataMng.AssetCategory.DIGI_STONE:
            text = "Common02_LB_Stone";
            this.exchangeDetailName = text2;
            break;

        case MasterDataMng.AssetCategory.LINK_POINT:
            text = "Common02_LB_Link";
            this.exchangeDetailName = text2;
            break;

        case MasterDataMng.AssetCategory.TIP:
            text = "Common02_LB_Chip";
            this.exchangeDetailName = text2;
            break;

        default:
            switch (assetCategory2)
            {
            case MasterDataMng.AssetCategory.MEAT:
                text = "Common02_item_meat";
                this.exchangeDetailName = text2;
                goto IL_567;

            case MasterDataMng.AssetCategory.SOUL:
            {
                this.exchangeDetailName = text2;
                GameWebAPI.RespDataMA_GetSoulM.SoulM soul = MasterDataMng.Instance().RespDataMA_SoulM.GetSoul(exchangeInfo.assetValue);
                value = soul.soulName;
                this.viewIconTexture.gameObject.SetActive(true);
                string evolveItemIconPathByID = ClassSingleton <EvolutionData> .Instance.GetEvolveItemIconPathByID(exchangeInfo.assetValue);

                NGUIUtil.ChangeUITextureFromFile(this.viewIconTexture, evolveItemIconPathByID, false);
                this.viewIcon.gameObject.SetActive(false);
                goto IL_567;
            }

            case MasterDataMng.AssetCategory.FACILITY_KEY:
            {
                this.viewIconTexture.gameObject.SetActive(true);
                this.viewIcon.gameObject.SetActive(false);
                FacilityConditionM[] facilityCondition         = FarmDataManager.GetFacilityCondition(exchangeInfo.assetValue);
                FacilityConditionM   facilityConditionM        = facilityCondition.FirstOrDefault((FacilityConditionM x) => int.Parse(x.conditionType) == 1);
                FacilityM            facilityMasterByReleaseId = FarmDataManager.GetFacilityMasterByReleaseId(facilityConditionM.releaseId);
                NGUIUtil.ChangeUITextureFromFile(this.viewIconTexture, facilityMasterByReleaseId.GetIconPath(), false);
                FacilityKeyM facilityKeyMaster = FarmDataManager.GetFacilityKeyMaster(exchangeInfo.assetValue);
                if (facilityKeyMaster != null)
                {
                    this.exchangeDetailName = facilityKeyMaster.facilityKeyName;
                }
                goto IL_567;
            }

            case MasterDataMng.AssetCategory.CHIP:
            {
                GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(exchangeInfo.assetValue);
                ChipDataMng.MakePrefabByChipData(chipMainData, this.viewIcon.gameObject, this.viewIcon.gameObject.transform.localPosition, this.viewIcon.gameObject.transform.localScale, null, 128, 128, false);
                this.exchangeDetailName = chipMainData.name;
                this.viewIcon.gameObject.SetActive(false);
                goto IL_567;
            }

            case MasterDataMng.AssetCategory.DUNGEON_TICKET:
            {
                this.viewIconTexture.gameObject.SetActive(true);
                this.viewIcon.gameObject.SetActive(false);
                GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM dungeonTicketM = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => exchangeInfo.assetValue == x.dungeonTicketId);
                if (dungeonTicketM != null)
                {
                    global::Debug.Log(dungeonTicketM.img);
                    NGUIUtil.ChangeUITextureFromFile(this.viewIconTexture, dungeonTicketM.img, false);
                    this.exchangeDetailName = dungeonTicketM.name;
                }
                goto IL_567;
            }
            }
            text = string.Empty;
            this.exchangeDetailName = StringMaster.GetString("Present-10");
            break;

        case MasterDataMng.AssetCategory.ITEM:
        {
            GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(exchangeInfo.assetValue);
            if (itemM != null)
            {
                this.exchangeDetailName = itemM.name;
                this.viewIconTexture.gameObject.SetActive(true);
                this.viewIcon.gameObject.SetActive(false);
                string largeImagePath = itemM.GetLargeImagePath();
                NGUIUtil.ChangeUITextureFromFile(this.viewIconTexture, largeImagePath, false);
            }
            break;
        }
        }
IL_567:
        if (!string.IsNullOrEmpty(text) && assetCategory2 != MasterDataMng.AssetCategory.MONSTER)
        {
            this.viewIcon.spriteName = text;
        }
        if (assetCategory2 == MasterDataMng.AssetCategory.TIP)
        {
            this.exchangeDetailNum = StringFormat.Cluster(exchangeInfo.assetNum);
        }
        else
        {
            this.exchangeDetailNum = exchangeInfo.assetNum;
        }
        if (assetCategory2 != MasterDataMng.AssetCategory.MONSTER)
        {
            this.titleLabel.text = string.Format(StringMaster.GetString("SystemItemCount"), this.exchangeDetailName, this.exchangeDetailNum);
        }
        else
        {
            this.titleLabel.text = this.exchangeDetailName;
        }
        if (!string.IsNullOrEmpty(value))
        {
            this.exchangeDetailName = value;
        }
        this.exchangeConsumeNum = exchangeInfo.needNum;
        this.buildNumLabel.text = this.exchangeConsumeNum;
        this.ExchangeIconSet(exchangeInfo);
        this.ResetNum(exchangeInfo);
        this.SetButton(exchangeInfo);
        this.ShowGUI();
    }
    public void SetItem(string assetCategoryId, string objectId, string num, bool isLoadASync = false, Action callback = null)
    {
        GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(assetCategoryId);
        MasterDataMng.AssetCategory assetCategory2 = (MasterDataMng.AssetCategory)assetCategory.assetCategoryId.ToInt32();
        this.itemName = this.GetPresentName(assetCategory, objectId);
        string arg;

        if (assetCategory2 == MasterDataMng.AssetCategory.TIP)
        {
            arg = StringFormat.Cluster(num);
        }
        else
        {
            arg = num;
        }
        if (this.itemNameLabel != null)
        {
            if (assetCategory2 == MasterDataMng.AssetCategory.FACILITY_KEY)
            {
                this.itemNameLabel.text = this.itemName;
            }
            else
            {
                this.itemNameLabel.text = string.Format(StringMaster.GetString("SystemItemCount"), this.itemName, arg);
            }
        }
        switch (assetCategory2)
        {
        case MasterDataMng.AssetCategory.MONSTER:
            if (null != this.monsterIcon)
            {
                UnityEngine.Object.Destroy(this.monsterIcon.gameObject);
            }
            this.monsterIcon = GUIMonsterIcon.MakePrefabByMonsterData(MonsterDataMng.Instance().CreateMonsterDataByMID(objectId), Vector3.one, Vector3.zero, this.iconSprite.transform, true, false);
            this.monsterIcon.ResizeIcon(this.iconSprite.width, this.iconSprite.height);
            if (null != this.monsterIcon)
            {
                DepthController depthController = this.monsterIcon.GetDepthController();
                if (null != depthController)
                {
                    depthController.AddWidgetDepth(this.monsterIcon.transform, this.iconSprite.depth + 10);
                }
            }
            if (callback != null)
            {
                callback();
            }
            break;

        case MasterDataMng.AssetCategory.DIGI_STONE:
        case MasterDataMng.AssetCategory.LINK_POINT:
        case MasterDataMng.AssetCategory.TIP:
        case MasterDataMng.AssetCategory.EXP:
        case MasterDataMng.AssetCategory.MEAT:
            this.iconSprite.enabled    = true;
            this.iconSprite.spriteName = this.GetSpriteName(assetCategory2);
            if (callback != null)
            {
                callback();
            }
            break;

        case MasterDataMng.AssetCategory.ITEM:
        case MasterDataMng.AssetCategory.SOUL:
        case MasterDataMng.AssetCategory.FACILITY_KEY:
        case MasterDataMng.AssetCategory.DUNGEON_TICKET:
            this.iconTexture.enabled = true;
            if (isLoadASync)
            {
                NGUIUtil.ChangeUITextureFromFileASync(this.iconTexture, this.GetTexturePath(assetCategory2, objectId), false, callback);
            }
            else
            {
                NGUIUtil.ChangeUITextureFromFile(this.iconTexture, this.GetTexturePath(assetCategory2, objectId), false);
                if (callback != null)
                {
                    callback();
                }
            }
            if (assetCategory2 == MasterDataMng.AssetCategory.FACILITY_KEY)
            {
                this.iconSprite.enabled    = true;
                this.iconSprite.spriteName = "Common02_item_flame";
            }
            break;

        case MasterDataMng.AssetCategory.CHIP:
        {
            GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(objectId);
            ChipDataMng.MakePrefabByChipData(chipMainData, this.iconSprite.gameObject, this.iconSprite.transform.localPosition, this.iconSprite.transform.localScale, delegate(ChipIcon result)
                {
                    if (callback != null)
                    {
                        callback();
                    }
                }, this.iconSprite.width, this.iconSprite.height, true);
            break;
        }
        }
        this.uiBasicSprites = base.transform.GetComponentsInParent <UIBasicSprite>(true);
    }
    public string DialogDataSet(GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM masterUpgradeCategory, MasterDataMng.AssetCategory assetCategoryId, GameWebAPI.RespDataGA_ExecGacha.GachaRewardsData RewardsData)
    {
        string text = string.Empty;

        if (masterUpgradeCategory != null)
        {
            text = masterUpgradeCategory.assetTitle;
        }
        string arg = string.Empty;

        this.iconTexture.gameObject.SetActive(false);
        this.iconSprite.gameObject.SetActive(false);
        this.textMore.gameObject.SetActive(false);
        switch (assetCategoryId)
        {
        case MasterDataMng.AssetCategory.MONSTER:
        {
            MonsterData    monsterData    = MonsterDataMng.Instance().CreateMonsterDataByMID(RewardsData.assetValue);
            GUIMonsterIcon guimonsterIcon = GUIMonsterIcon.MakePrefabByMonsterData(MonsterDataMng.Instance().CreateMonsterDataByMID(RewardsData.assetValue), Vector3.one, Vector3.zero, this.iconSprite.transform, true, false);
            guimonsterIcon.ResizeIcon(this.iconSprite.width, this.iconSprite.height);
            if (null != guimonsterIcon)
            {
                DepthController depthController = guimonsterIcon.GetDepthController();
                if (null != depthController)
                {
                    depthController.AddWidgetDepth(guimonsterIcon.transform, this.iconSprite.depth + 10);
                    this.iconSprite.gameObject.SetActive(true);
                }
            }
            arg = monsterData.monsterMG.monsterName;
            break;
        }

        case MasterDataMng.AssetCategory.DIGI_STONE:
            arg = text;
            this.iconSprite.gameObject.SetActive(true);
            this.iconSprite.spriteName = this.GetSpriteName(assetCategoryId);
            break;

        case MasterDataMng.AssetCategory.LINK_POINT:
            arg = text;
            this.iconSprite.gameObject.SetActive(true);
            this.iconSprite.spriteName = this.GetSpriteName(assetCategoryId);
            break;

        case MasterDataMng.AssetCategory.TIP:
            this.iconSprite.gameObject.SetActive(true);
            this.iconSprite.spriteName = this.GetSpriteName(assetCategoryId);
            arg = text;
            break;

        default:
            switch (assetCategoryId)
            {
            case MasterDataMng.AssetCategory.MEAT:
                this.iconSprite.gameObject.SetActive(true);
                this.iconSprite.spriteName = this.GetSpriteName(assetCategoryId);
                arg = text;
                goto IL_2FA;

            case MasterDataMng.AssetCategory.SOUL:
            {
                GameWebAPI.RespDataMA_GetSoulM.SoulM soul = MasterDataMng.Instance().RespDataMA_SoulM.GetSoul(RewardsData.assetValue);
                arg = soul.soulName;
                NGUIUtil.ChangeUITextureFromFile(this.iconTexture, this.GetTexturePath(assetCategoryId, RewardsData.assetValue), false);
                this.iconTexture.gameObject.SetActive(true);
                goto IL_2FA;
            }

            case MasterDataMng.AssetCategory.FACILITY_KEY:
                arg = text;
                goto IL_2FA;

            case MasterDataMng.AssetCategory.CHIP:
            {
                GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(RewardsData.assetValue);
                ChipDataMng.MakePrefabByChipData(chipMainData, this.iconSprite.gameObject, this.iconSprite.transform.localPosition, this.iconSprite.transform.localScale, null, -1, -1, true);
                arg = chipMainData.name;
                goto IL_2FA;
            }
            }
            arg = StringMaster.GetString("Present-10");
            break;

        case MasterDataMng.AssetCategory.ITEM:
        {
            GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(RewardsData.assetValue);
            if (itemM != null)
            {
                arg = itemM.name;
                NGUIUtil.ChangeUITextureFromFile(this.iconTexture, this.GetTexturePath(assetCategoryId, RewardsData.assetValue), false);
                this.iconTexture.gameObject.SetActive(true);
            }
            break;
        }
        }
IL_2FA:
        return(string.Format(StringMaster.GetString("CaptureBonusItem"), arg, RewardsData.count));
    }
Ejemplo n.º 6
0
        private bool SetTexture(MasterDataMng.AssetCategory category, string assetsValue, UITexture texture)
        {
            bool   result = true;
            string text   = string.Empty;

            switch (category)
            {
            case MasterDataMng.AssetCategory.GATHA_TICKET:
                break;

            default:
                if (category != MasterDataMng.AssetCategory.ITEM)
                {
                    result = false;
                }
                else
                {
                    GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(assetsValue);
                    if (itemM != null)
                    {
                        text = itemM.GetLargeImagePath();
                    }
                }
                break;

            case MasterDataMng.AssetCategory.SOUL:
            {
                GameWebAPI.RespDataMA_GetSoulM.SoulM soul = MasterDataMng.Instance().RespDataMA_SoulM.GetSoul(assetsValue);
                if (soul != null)
                {
                    text = ClassSingleton <EvolutionData> .Instance.GetEvolveItemIconPathByID(assetsValue);
                }
                break;
            }

            case MasterDataMng.AssetCategory.FACILITY_KEY:
            {
                FacilityM facilityMasterByReleaseId = FarmDataManager.GetFacilityMasterByReleaseId(assetsValue);
                if (facilityMasterByReleaseId != null)
                {
                    text = facilityMasterByReleaseId.GetIconPath();
                }
                break;
            }

            case MasterDataMng.AssetCategory.DUNGEON_TICKET:
            {
                GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM ticketMaster = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.GetTicketMaster(assetsValue);
                if (ticketMaster != null)
                {
                    text = ticketMaster.img;
                }
                break;
            }
            }
            if (!string.IsNullOrEmpty(text))
            {
                NGUIUtil.ChangeUITextureFromFile(texture, text, false);
            }
            return(result);
        }
Ejemplo n.º 7
0
    public void SetDetail(FacilityM facilityMaster, FacilityConditionM[] facilityConditionMaster, bool[] isClearConditions, Action <FacilityShopItem> touchEvent)
    {
        this.facilityID        = int.Parse(facilityMaster.facilityId);
        this.onPushedBuyButton = touchEvent;
        FacilityM facilityMaster2 = FarmDataManager.GetFacilityMaster(this.facilityID);

        NGUIUtil.ChangeUITextureFromFile(this.facilityIcon, facilityMaster2.GetIconPath(), false);
        if (isClearConditions.Any((bool x) => !x))
        {
            this.DetailSetActive(false);
            this.lockDetail.SetActive(true);
            this.conditionTitle.text       = string.Format(StringMaster.GetString("FacilityShopConditionTitle"), facilityMaster.facilityName);
            this.buildCountTitle.text      = StringMaster.GetString("FacilityShopBuildNum");
            this.buildTimeTitle.text       = StringMaster.GetString("FarmEditStockTime");
            this.eventBuildCountTitle.text = StringMaster.GetString("FacilityShopBuildNum");
            this.eventBuildTimeTitle.text  = StringMaster.GetString("FarmEditStockTime");
            for (int i = 0; i < facilityConditionMaster.Length; i++)
            {
                if (!(null == this.conditionTexts[i]))
                {
                    FacilityConditionM facilityConditionM = facilityConditionMaster[i];
                    if (string.IsNullOrEmpty(facilityConditionM.description))
                    {
                        this.conditionTexts[i].text = StringMaster.GetString("FacilityShopConditionUnknow");
                    }
                    else
                    {
                        this.conditionTexts[i].text = facilityConditionM.description;
                    }
                    if (!isClearConditions[i])
                    {
                        this.conditionTexts[i].color = this.nonClearColor;
                    }
                }
            }
            for (int j = facilityConditionMaster.Length; j < this.conditionTexts.Length; j++)
            {
                if (!(null == this.conditionTexts[j]))
                {
                    this.conditionTexts[j].gameObject.SetActive(false);
                }
            }
            if (facilityConditionMaster.Length == 1 && null != this.conditionLine)
            {
                this.conditionLine.SetActive(false);
            }
            if (0 < facilityConditionMaster.Length && facilityConditionMaster[0].conditionType == 5.ToString())
            {
                this.ChangeEventItemMode();
            }
        }
        else
        {
            this.DetailSetActive(true);
            this.lockDetail.SetActive(false);
            UILabel uilabel = this.facilityName;
            string  text    = facilityMaster.facilityName;
            this.eventFacilityName.text = text;
            uilabel.text = text;
            int nowCount = this.GetNowCount();
            int num      = int.Parse(facilityMaster.maxNum);
            if (nowCount != -1)
            {
                UILabel uilabel2 = this.buildCount;
                text = string.Format(StringMaster.GetString("SystemFraction"), nowCount, facilityMaster.maxNum);
                this.eventBuildCount.text = text;
                uilabel2.text             = text;
            }
            this.buildTime.text = facilityMaster.buildingTime.ToBuildTime();
            if (int.Parse(facilityMaster.buildingAssetCategoryId1) == 4)
            {
                this.buyTypeTip.gameObject.SetActive(true);
                this.price.text = StringFormat.Cluster(facilityMaster.buildingAssetNum1);
            }
            else
            {
                this.buyTypeStone.gameObject.SetActive(true);
                this.price.text = facilityMaster.buildingAssetNum1;
            }
            if (FarmUtility.IsShortage(facilityMaster.buildingAssetCategoryId1, facilityMaster.buildingAssetNum1))
            {
                this.SetButtonGrayout();
            }
            if (nowCount >= num)
            {
                this.SetButtonLimit();
            }
            if (0 < facilityConditionMaster.Length && facilityConditionMaster[0].conditionType == 5.ToString())
            {
                this.BuildEventItemMode();
            }
        }
    }
    private void InfoSetting()
    {
        this.goListPartsExchange.SetActive(false);
        if (CMD_ClearingHouse.exchangeResultInfo == null || CMD_ClearingHouse.exchangeResultInfo.detail == null || CMD_ClearingHouse.exchangeResultInfo.detail.Length == 0)
        {
            base.PartsTitle.SetTitle(StringMaster.GetString("ExchangeTitle"));
            this.goEFC_LEFT.SetActive(false);
            this.exchangeEmptyLabel.gameObject.SetActive(true);
            return;
        }
        if (!string.IsNullOrEmpty(CMD_ClearingHouse.exchangeResultInfo.name))
        {
            base.PartsTitle.SetTitle(CMD_ClearingHouse.exchangeResultInfo.name);
        }
        else
        {
            base.PartsTitle.SetTitle(StringMaster.GetString("ExchangeTitle"));
        }
        for (int i = 0; i < this.exchangeBaseObject.Count; i++)
        {
            this.exchangeBaseObject[i].SetActive(false);
        }
        for (int j = 0; j < CMD_ClearingHouse.exchangeResultInfo.detail.Length; j++)
        {
            string assetCategoryId = CMD_ClearingHouse.exchangeResultInfo.detail[j].item.assetCategoryId;
            string assetValue      = CMD_ClearingHouse.exchangeResultInfo.detail[j].item.assetValue;
            string key             = assetCategoryId + assetValue;
            if (!this.itemDictionary.ContainsKey(key) || (this.itemDictionary.ContainsKey(key) && this.itemDictionary[key] != assetValue))
            {
                this.itemDictionary.Add(key, assetValue);
                this.exchangeItemDataList.Add(CMD_ClearingHouse.exchangeResultInfo.detail[j].item);
            }
        }
        int num = 0;

        foreach (string key2 in this.itemDictionary.Keys)
        {
            string itemId = this.exchangeItemDataList[num].assetValue;
            this.exchangeConsumeItemInfo = MasterDataMng.Instance().RespDataMA_ItemM.itemM.SingleOrDefault((GameWebAPI.RespDataMA_GetItemM.ItemM x) => x.itemId == itemId);
            if (this.exchangeBaseObject.Count > num)
            {
                this.exchangeConsumeItemNumLabel[num].text = this.exchangeItemDataList[num].count.ToString();
            }
            string assetCategoryId2  = this.exchangeItemDataList[num].assetCategoryId;
            string consumeAssetValue = this.itemDictionary[key2];
            MasterDataMng.AssetCategory assetCategory = (MasterDataMng.AssetCategory) int.Parse(assetCategoryId2);
            if (assetCategory == MasterDataMng.AssetCategory.ITEM)
            {
                if (this.exchangeBaseObject.Count > num)
                {
                    this.exchangeConsumeSprite[num].enabled  = false;
                    this.exchangeConsumeTexture[num].enabled = true;
                }
                if (this.exchangeConsumeItemInfo != null)
                {
                    this.exchangeConsumeItemTexturePath = this.exchangeConsumeItemInfo.GetSmallImagePath();
                    this.exchangeItemPathList.Add(this.exchangeConsumeItemTexturePath);
                    this.exchangeConsumeItemName.Add(this.exchangeConsumeItemInfo.name);
                    if (this.exchangeBaseObject.Count > num)
                    {
                        NGUIUtil.ChangeUITextureFromFile(this.exchangeConsumeTexture[num], this.exchangeConsumeItemTexturePath, false);
                    }
                }
            }
            else
            {
                if (this.exchangeBaseObject.Count > num)
                {
                    this.exchangeConsumeSprite[num].enabled  = true;
                    this.exchangeConsumeTexture[num].enabled = false;
                }
                GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory2 = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(assetCategoryId2);
                if (assetCategory2 != null)
                {
                    this.exchangeConsumeItemName.Add(assetCategory2.assetTitle);
                }
                string text = string.Empty;
                switch (assetCategory)
                {
                case MasterDataMng.AssetCategory.DIGI_STONE:
                    text = "Common02_ShopList_1";
                    this.exchangeItemPathList.Add(text);
                    break;

                case MasterDataMng.AssetCategory.LINK_POINT:
                    text = "Common02_Icon_Link";
                    this.exchangeItemPathList.Add(text);
                    break;

                case MasterDataMng.AssetCategory.TIP:
                    text = "Common02_Icon_Chip";
                    this.exchangeItemPathList.Add(text);
                    break;

                default:
                    switch (assetCategory)
                    {
                    case MasterDataMng.AssetCategory.MEAT:
                        text = "Common02_Icon_Meat";
                        this.exchangeItemPathList.Add(text);
                        break;

                    case MasterDataMng.AssetCategory.SOUL:
                        this.exchangeConsumeItemTexturePath = ClassSingleton <EvolutionData> .Instance.GetEvolveItemIconPathByID(consumeAssetValue);

                        if (this.exchangeBaseObject.Count > num)
                        {
                            this.exchangeConsumeTexture[num].enabled = true;
                            NGUIUtil.ChangeUITextureFromFile(this.exchangeConsumeTexture[num], this.exchangeConsumeItemTexturePath, false);
                        }
                        this.exchangeItemPathList.Add(this.exchangeConsumeItemTexturePath);
                        break;

                    case MasterDataMng.AssetCategory.DUNGEON_TICKET:
                    {
                        GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM dungeonTicketM = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => consumeAssetValue == x.dungeonTicketId);
                        if (dungeonTicketM != null)
                        {
                            this.exchangeConsumeItemTexturePath = dungeonTicketM.img;
                            this.exchangeItemPathList.Add(this.exchangeConsumeItemTexturePath);
                            if (this.exchangeBaseObject.Count > num)
                            {
                                this.exchangeConsumeTexture[num].enabled = true;
                                if (dungeonTicketM != null)
                                {
                                    NGUIUtil.ChangeUITextureFromFile(this.exchangeConsumeTexture[num], this.exchangeConsumeItemTexturePath, false);
                                }
                            }
                        }
                        break;
                    }
                    }
                    break;
                }
                if (this.exchangeBaseObject.Count > num)
                {
                    if (!string.IsNullOrEmpty(text))
                    {
                        this.exchangeConsumeSprite[num].spriteName = text;
                    }
                    else
                    {
                        this.exchangeConsumeSprite[num].enabled = false;
                    }
                }
            }
            if (this.exchangeBaseObject.Count > num)
            {
                this.exchangeBaseObject[num].SetActive(true);
            }
            num++;
        }
        if (CMD_ClearingHouse.exchangeResultInfo.IsAlways())
        {
            this.exchangeLimitLabel.transform.parent.gameObject.SetActive(false);
        }
        else
        {
            base.InvokeRepeating("TimeSetting", 1f, 1f);
            this.TimeSetting();
        }
        this.SetCommonUI_Exchange();
        this.InitExchangeList();
        this.SetExchangeDetail();
    }
Ejemplo n.º 9
0
    public void SetFace(string faceType)
    {
        string texname = "UITexture/Common02_Nabi_" + faceType;

        NGUIUtil.ChangeUITextureFromFile(this.monitor, texname, false);
    }