コード例 #1
0
        public override void Init <T>(string name, UIInfo info, T arg)
        {
            base.Init(name, info, arg);

            RegisterListeners();
            //处理离线奖励
            double nowMills = DateTimeUtil.GetMills(DateTime.Now);

            offlineConfig = Global.gApp.gGameData.GeneralConfigData.Get(GeneralConfigConstVal.OFFLINE_PARAMS);
            float count = (float)((nowMills - Global.gApp.gSystemMgr.GetMiscMgr().GetLastOffline()) / 1000) * float.Parse(offlineConfig.contents[0]);
            float limit = float.Parse(offlineConfig.contents[3]);

            if (count > limit)
            {
                count = limit;
            }
            m_AddItemDTO = new ItemDTO(Convert.ToInt32(offlineConfig.contents[2]), count, BehaviorTypeConstVal.OPT_OFFLINE);

            Itemvaluetxt.text.text = UiTools.FormateMoneyUP(count);
            m_ConsumeItemDTO       = new ItemDTO(Convert.ToInt32(offlineConfig.contents[4]), float.Parse(offlineConfig.contents[5]), BehaviorTypeConstVal.OPT_OFFLINE);

            MoneyIcon.image.sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(string.Format(CommonResourceConstVal.RESOURCE_PATH, m_ConsumeItemDTO.itemId));
            AdText.text.text       = "× " + offlineConfig.contents[7];
            MoneyText.text.text    = m_ConsumeItemDTO.num + " × " + offlineConfig.contents[6];

            AdBtn.button.onClick.AddListener(OnAdBtn);
            MoneyBtn.button.onClick.AddListener(OnMoneyBtn);
            Btn1.button.onClick.AddListener(TouchClose);

            base.ChangeLanguage();
        }
コード例 #2
0
        private void InitNode()
        {
            ShopItem chargeItemConfig = Global.gApp.gGameData.ShopConfig.Get(m_ShopId);

            Itemicon.image.sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(chargeItemConfig.itemIcon);
            if (chargeItemConfig.consumeType == SpecialItemIdConstVal.REAL_MONEY)
            {
                Moneycostbtn.text.text = "$ " + chargeItemConfig.price.ToString();
                Moneyiconbtn.gameObject.SetActive(false);
            }
            else
            {
                Moneycostbtn.text.text = UiTools.FormateMoneyUP(chargeItemConfig.price);
                Moneyiconbtn.gameObject.SetActive(true);
                Moneyiconbtn.image.sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(string.Format(CommonResourceConstVal.RESOURCE_PATH, chargeItemConfig.consumeType));
            }

            Itemvaluetxt.text.text = UiTools.FormateMoneyUP(m_ItemNum);
            Itemvalueicon.gameObject.SetActive(true);
            Itemvalueicon.image.sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(string.Format(CommonResourceConstVal.RESOURCE_PATH, chargeItemConfig.goodsType));


            ItemItem itemConfig = Global.gApp.gGameData.ItemData.Get(chargeItemConfig.goodsType);

            Confirmtxt3.text.text = itemConfig.gamename;

            Btn1.button.onClick.AddListener(TouchClose);
            Btn2.button.onClick.AddListener(Buy);
        }
コード例 #3
0
        public override void Init <T>(string name, UIInfo info, T arg)
        {
            base.Init(name, info, arg);
            Global.gApp.gGameCtrl.AddGlobalTouchMask();
            m_ItemDTOs = arg as List <ItemDTO>;
            m_Cards    = new List <OpenMixBoxUI_card>();

            box_open.gameObject.SetActive(false);
            box_close.gameObject.SetActive(true);
            card.gameObject.SetActive(false);
            for (int i = m_ItemDTOs.Count - 1; i >= 0; i--)
            {
                ItemDTO           itemDTO = m_ItemDTOs[i];
                OpenMixBoxUI_card cardUI  = card.GetInstance();
                ItemItem          itemCfg = Global.gApp.gGameData.ItemData.Get(itemDTO.itemId);
                cardUI.num.text.text     = UiTools.FormateMoneyUP(itemDTO.num);
                cardUI.icon.image.sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(string.Format(CommonResourceConstVal.RESOURCE_PATH, itemDTO.itemId));
                m_Cards.Add(cardUI);
                cardUI.gameObject.SetActive(true);
                cardUI.Show.gameObject.SetActive(false);
                cardUI.title.text.text = Global.gApp.gGameData.GetTipsInCurLanguage(itemCfg.sourceLanguage);
            }

            gameObject.AddComponent <DelayCallBack>().SetAction(() =>
            {
                OnOpen();
            }, m_Delay, true);
            RegisterListeners();

            base.ChangeLanguage();
        }
コード例 #4
0
        public void UIFresh()
        {
            ItemItem itemItem = Global.gApp.gGameData.ItemData.Get(m_CampShopItem.propId);

            //武器需要根据当前情况处理
            if (itemItem != null && GameItemFactory.GetInstance().GetItem(m_CampShopItem.propId) > 0)
            {
                Global.gApp.gSystemMgr.GetNpcMgr().CampShopTimesMap[m_CampShopItem.id.ToString()] = 1;
                Global.gApp.gSystemMgr.GetNpcMgr().SaveData();
            }

            MatIcon.image.sprite = Resources.Load(itemItem.image_grow, typeof(Sprite)) as Sprite;
            double addNum = m_CampShopItem.propNum;

            if (m_CampShopItem.propId == SpecialItemIdConstVal.GOLD)
            {
                Gold_paramsItem gpiCfg = Global.gApp.gGameData.GoldParamsConfig.Get(Global.gApp.gSystemMgr.GetBaseAttrMgr().GetLevel());
                addNum *= gpiCfg.coinParams;
            }
            m_ExchangeCount.text.text = "X " + UiTools.FormateMoneyUP(addNum);
            HeartCount.text.text      = m_CampShopItem.heartNum.ToString();
            HeartCount.text.color     = ColorUtil.GetTextColor(GameItemFactory.GetInstance().GetItem(SpecialItemIdConstVal.RED_HEART) < m_CampShopItem.heartNum, "#FDE47EFF");

            bool limit = Global.gApp.gSystemMgr.GetNpcMgr().CampShopTimesMap[m_CampShopItem.id.ToString()] >= m_CampShopItem.limitButTimes;

            ExchangeNode.gameObject.SetActive(!limit);
            SellOut.gameObject.SetActive(limit);
            MatIcon.image.color = limit ? ColorUtil.GetColor(ColorUtil.m_BlackColor) : ColorUtil.GetColor(ColorUtil.m_DeaultColor);

            MatName.text.text = itemItem.gamename;
            ExchangeCount.gameObject.SetActive(false);
        }
コード例 #5
0
        public void InitNode(NpcQuestItemDTO dto, int index, CampTaskDetails parent)
        {
            m_DTO    = dto;
            m_Index  = index;
            m_Parent = parent;
            CampTasksItem taskCfg = Global.gApp.gGameData.CampTasksConfig.Get(m_DTO.npcQuestId);

            gameObject.SetActive(true);
            if (taskCfg.taskCondition[0] == FilterTypeConstVal.GET_ITEM)
            {
                ItemItem itemCfg = Global.gApp.gGameData.ItemData.Get(Convert.ToInt32(taskCfg.taskCondition[1]));
                IName.text.text            = Global.gApp.gGameData.GetTipsInCurLanguage(itemCfg.sourceLanguage);
                TargetIcon.image.sprite    = Resources.Load(itemCfg.image_grow, typeof(Sprite)) as Sprite;
                TaskTargetText.text.text   = string.Format(Global.gApp.gGameData.GetTipsInCurLanguage(taskCfg.describe), Global.gApp.gGameData.GetTipsInCurLanguage(itemCfg.sourceLanguage));
                TaskTargetAmount.text.text = taskCfg.taskCondition[taskCfg.taskCondition.Length - 1].ToString();
            }
            else if (taskCfg.taskCondition[0] == FilterTypeConstVal.KILL_ZOMBIE)
            {
                IName.text.text            = Global.gApp.gGameData.GetTipsInCurLanguage(4265);
                TargetIcon.image.sprite    = Resources.Load(CommonResourceConstVal.CAMP_KILL_ICON, typeof(Sprite)) as Sprite;
                TaskTargetText.text.text   = Global.gApp.gGameData.GetTipsInCurLanguage(taskCfg.describe);
                TaskTargetAmount.text.text = taskCfg.taskCondition[taskCfg.taskCondition.Length - 1].ToString();
            }
            else if (taskCfg.taskCondition[0] == FilterTypeConstVal.GET_ITEM_BY_TYPE)
            {
                IName.text.text            = Global.gApp.gGameData.GetTipsInCurLanguage(4268);
                TargetIcon.image.sprite    = Resources.Load(CommonResourceConstVal.CAMP_GET_TYPE_ITEM_ICON, typeof(Sprite)) as Sprite;
                TaskTargetText.text.text   = Global.gApp.gGameData.GetTipsInCurLanguage(taskCfg.describe);
                TaskTargetAmount.text.text = taskCfg.taskCondition[taskCfg.taskCondition.Length - 1].ToString();
            }
            else
            {
                Debug.LogError("该条件类型未告知如何显示 taskCfg.taskCondition[0] = " + taskCfg.taskCondition[0]);
            }
            string cur = m_DTO.cur > taskCfg.taskCondition[taskCfg.taskCondition.Length - 1] ? taskCfg.taskCondition[taskCfg.taskCondition.Length - 1].ToString() : m_DTO.cur.ToString();

            Amount.text.text          = cur + "/" + taskCfg.taskCondition[taskCfg.taskCondition.Length - 1].ToString();
            Progress.image.fillAmount = Convert.ToSingle(m_DTO.cur / taskCfg.taskCondition[taskCfg.taskCondition.Length - 1]);

            if (int.Parse(taskCfg.reward[0]) == SpecialItemIdConstVal.GOLD)
            {
                Gold_paramsItem gpiCfg = Global.gApp.gGameData.GoldParamsConfig.Get(Global.gApp.gSystemMgr.GetBaseAttrMgr().GetLevel());
                AwardAmount.text.text = UiTools.FormateMoneyUP(double.Parse(taskCfg.reward[1]) * gpiCfg.coinParams);
            }
            else
            {
                AwardAmount.text.text = UiTools.FormateMoneyUP(int.Parse(taskCfg.reward[1]));
            }

            ItemItem awardItem = Global.gApp.gGameData.ItemData.Get(int.Parse(taskCfg.reward[0]));

            AwardIcon.image.sprite = Resources.Load(awardItem.image_grow, typeof(Sprite)) as Sprite;
            ChangeStateAndIndex();
            Btn.button.onClick.AddListener(OnReceive);
        }
コード例 #6
0
        public override void Init <T>(string name, UIInfo info, T arg)
        {
            base.Init(name, info, arg);

            m_ItemDTO = arg as ItemDTO;
            ConsumeValue.text.text   = "×" + UiTools.FormateMoneyUP(m_ItemDTO.num);
            ConsumeIcon.image.sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(string.Format(CommonResourceConstVal.RESOURCE_PATH, m_ItemDTO.itemId));
            box_open.gameObject.SetActive(false);
            box_close.gameObject.SetActive(true);
            ItemItem itemCfg = Global.gApp.gGameData.ItemData.Get(m_ItemDTO.itemId);

            if (itemCfg != null)
            {
                if (itemCfg.openBoxImg != null && itemCfg.openBoxImg != string.Empty)
                {
                    box_open.image.sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(itemCfg.openBoxImg);
                }
                if (itemCfg.closeBoxImg != null && itemCfg.closeBoxImg != string.Empty)
                {
                    box_close.image.sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(itemCfg.closeBoxImg);
                }
            }

            m_UI_openbox_white.gameObject.SetActive(m_ItemDTO.itemId == SpecialItemIdConstVal.ENERGY);
            m_UI_openbox_purple.gameObject.SetActive(m_ItemDTO.itemId == SpecialItemIdConstVal.MDT);
            m_UI_openbox.gameObject.SetActive(m_ItemDTO.itemId != SpecialItemIdConstVal.ENERGY && m_ItemDTO.itemId != SpecialItemIdConstVal.MDT);

            bool haveThree = itemCfg.id == SpecialItemIdConstVal.GOLD;

            Btn1.gameObject.SetActive(haveThree);
            Btn2.gameObject.SetActive(haveThree);
            if (haveThree)
            {
                Btn1.button.onClick.AddListener(OnClick1);
                Btn2.button.onClick.AddListener(OnClick3);
                CmNum.text.text   = UiTools.FormateMoney(m_ItemDTO.num);
                CmNumAd.text.text = UiTools.FormateMoney(m_ItemDTO.num * m_ADTimes);
            }
            else
            {
                gameObject.AddComponent <DelayCallBack>().SetAction(() =>
                {
                    if (m_ItemDTO.param3 > 0)
                    {
                        Global.gApp.gSystemMgr.GetQuestMgr().ReceiveQuest((int)m_ItemDTO.param3, 1, BehaviorTypeConstVal.OPT_LEVEL_DETAIL);
                    }

                    OnOpen();
                }, 0.8f, true);
            }


            RegisterListeners();
            base.ChangeLanguage();
        }
コード例 #7
0
        private void InitCoinInfo()
        {
            FallBox_dataItem config = Global.gApp.gGameData.FallBoxDataConfig.Get(Global.gApp.gSystemMgr.GetBaseAttrMgr().GetLevel());

            mCoin             = config.coin;
            CmNum.text.text   = UiTools.FormateMoneyUP(mCoin);
            CmNumAd.text.text = UiTools.FormateMoneyUP(mCoin * mAdTimes);

            airdropicon_close.gameObject.SetActive(true);
            airdropicon_open.gameObject.SetActive(false);
        }
コード例 #8
0
        private void OnOpen()
        {
            Btn1.gameObject.SetActive(false);
            Btn2.gameObject.SetActive(false);
            ConsumeValue.text.text = "×" + UiTools.FormateMoneyUP(m_ItemDTO.num);

            //Tweener tweener = box_close.rectTransform.DOShakeScale(1f, new Vector3(0.08f, 0.08f, 0.08f), 6, 90);
            Tweener tweener = box_close.rectTransform.DOPunchRotation(new Vector3(0, 0, 7), 0.6f, 40, 1);

            tweener.SetEase(Ease.OutCubic);
            tweener.SetLoops(1);
            tweener.OnComplete(CompleteOpen);
            tweener.Play();
        }
コード例 #9
0
        public void Init(ShopItem itemConfig, int i)
        {
            m_Index   = i;
            m_ShopId  = itemConfig.id;
            effct_num = itemConfig.effectNum;

            Shop_dataItem shop_DataItem = Global.gApp.gGameData.ShopDataConfig.Get(Global.gApp.gSystemMgr.GetBaseAttrMgr().GetLevel());

            if (shop_DataItem != null)
            {
                m_ItemNum            = ReflectionUtil.GetValueByProperty <Shop_dataItem, float>("stageGet_" + (i + 1), shop_DataItem);
                m_Valuetxt.text.text = UiTools.FormateMoneyUP(m_ItemNum);
            }
            else
            {
                m_Valuetxt.text.text = GameConstVal.EmepyStr;
            }

            CmIcon.image.sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(string.Format(CommonResourceConstVal.RESOURCE_PATH, itemConfig.goodsType));

            ItemIcon.image.sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(itemConfig.itemIcon);

            if (itemConfig.consumeType == SpecialItemIdConstVal.REAL_MONEY)
            {
                ConsumeValue.text.text = "$ " + itemConfig.price.ToString();
                ConsumeIcon.gameObject.SetActive(false);
            }
            else
            {
                ConsumeValue.text.text = "  " + UiTools.FormateMoneyUP(itemConfig.price);
                ConsumeIcon.gameObject.SetActive(true);
                ConsumeIcon.image.sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(string.Format(CommonResourceConstVal.RESOURCE_PATH, itemConfig.consumeType));

                ConsumeValue.text.color = ColorUtil.GetTextColor(GameItemFactory.GetInstance().GetItem(itemConfig.consumeType) < itemConfig.price, null);
            }

            Cmbglight.image.sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(itemConfig.bgLight);

            EffectItem effectItem = Global.gApp.gGameData.EffectData.Get(EffectConstVal.SHOP_GOLD);
            string     location   = System.Text.RegularExpressions.Regex.Replace(itemConfig.itemIcon, @"[^0-9]+", GameConstVal.EmepyStr);
            GameObject effect     = UiTools.GetEffect(string.Format(effectItem.path, location), transform);

            if (mEffect != null)
            {
                GameObject.Destroy(mEffect);
            }
            mEffect = effect;
            gameObject.SetActive(true);
        }
コード例 #10
0
        private void InitNode()
        {
            ItemItem itemItem = Global.gApp.gGameData.ItemData.Get(m_CampRecycleItem.id);

            MatName.text.text    = itemItem.name;
            MatIcon.image.sprite = Resources.Load(itemItem.image_grow, typeof(Sprite)) as Sprite;

            MatPrice.text.text = UiTools.FormateMoneyUP(m_CampRecycleItem.price * m_GoldParam);

            MatDes.text.text = Global.gApp.gGameData.GetTipsInCurLanguage(m_CampRecycleItem.dec);;

            FreshSellInfo();
            Reduce10.button.onClick.AddListener(ReduceTen);
            Reduce1.button.onClick.AddListener(ReduceOne);
            Add1.button.onClick.AddListener(AddOne);
            Max.button.onClick.AddListener(OnMax);
            ConfirmBtn.button.onClick.AddListener(OnConfirm);

            CloseBtn.button.onClick.AddListener(TouchClose);
        }
コード例 #11
0
        private void InitNode()
        {
            CampShopItem campShopItem = m_ItemUI.GetCampItem();

            CloseBtn.button.onClick.AddListener(TouchClose);
            ConfirmBtn.button.onClick.AddListener(OnConfirmExchange);
            double addNum = campShopItem.propNum;

            if (campShopItem.propId == SpecialItemIdConstVal.GOLD)
            {
                Gold_paramsItem gpiCfg = Global.gApp.gGameData.GoldParamsConfig.Get(Global.gApp.gSystemMgr.GetBaseAttrMgr().GetLevel());
                addNum *= gpiCfg.coinParams;
            }
            ExchangeCount.text.text = "x" + UiTools.FormateMoneyUP(addNum);
            ItemItem itemItem = Global.gApp.gGameData.ItemData.Get(campShopItem.propId);

            MatIcon.image.sprite = Resources.Load(itemItem.image_grow, typeof(Sprite)) as Sprite;
            MatName.text.text    = itemItem.gamename;
            HeartCount.text.text = campShopItem.heartNum.ToString();
        }
コード例 #12
0
        private void InitNode()
        {
            ExchangeAllBtn.button.onClick.AddListener(ExChangeAllUnUseMat);
            ExpansionBtn.button.onClick.AddListener(ShowAllExPansionMat);
            AllExchangeMatBg.button.onClick.AddListener(CloseAllExPansionMat);
            double exchangeCoinCount = 0;

            foreach (KeyValuePair <int, double> keyValue in m_RecyclyMat)
            {
                CampRecycleItem campRecycleItem = Global.gApp.gGameData.CampRecycleConfig.Get(keyValue.Key);
                exchangeCoinCount += campRecycleItem.price * ((int)keyValue.Value);
            }
            Gold_paramsItem gpiCfg = Global.gApp.gGameData.GoldParamsConfig.Get(Global.gApp.gSystemMgr.GetBaseAttrMgr().GetLevel());

            exchangeCoinCount *= gpiCfg.coinParams;
            Num.text.text      = UiTools.FormateMoneyUP(exchangeCoinCount);

            GeneratePartyRecycleMat();
            GenerateAllRecycleMat();
        }
コード例 #13
0
        private void FlushPanelInfo()
        {
            //CmNum3.text.text = UiTools.FormateMoneyUP(tmp * FightResultManager.MULT_PARAM);

            //var playerGo = Global.gApp.CurScene.GetMainPlayer();
            //if (playerGo == null)
            //    return;

            //var player = playerGo.GetComponent<Player>();
            //var curLife = player.GetPlayerData().GetHp();
            //var maxLife = player.GetPlayerData().GetMaxHp();
            //var reviveCount = player.GetPlayerData().GetReviveTimes();

            var stageData = PlayerDataMgr.singleton.GetStageData(PlayerDataMgr.singleton.EnterStageID);

            if (stageData == null)
            {
                return;
            }

            var starList = stageData.starList;

            ShowStars(starList);
            //CmNum.text.text = "";

            //else
            //{
            double gold = FightResultManager.instance.AwardGold;

            CmNum.text.text = UiTools.FormateMoneyUP(gold);

            //Game.PlayerDataMgr.singleton.RequestFinishStage((int)(gold), (b) =>
            //{
            //    if (b)
            //    {
            //        var starList = Game.PlayerDataMgr.singleton.GetStageStarList(true, curLife / maxLife, reviveCount);
            //        ShowStars(starList);
            //    }
            //});
            //}
        }
コード例 #14
0
        public override void Init <T>(string name, UIInfo info, T arg)
        {
            base.Init(name, info, arg);

            m_questItemDTO           = arg as QuestItemDTO;
            m_QuestCfg               = Global.gApp.gGameData.QuestData.Get(m_questItemDTO.id);
            airdropicon.image.sprite = Resources.Load(m_QuestCfg.awardIcon, typeof(Sprite)) as Sprite;
            ItemItem awardCfg = Global.gApp.gGameData.ItemData.Get((int)m_QuestCfg.award[0]);

            if (ItemTypeConstVal.isWeapon(awardCfg.showtype))
            {
                CmIcon.gameObject.SetActive(false);
                CmNum.gameObject.SetActive(false);
            }
            else
            {
                CmIcon.image.sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(string.Format(CommonResourceConstVal.RESOURCE_PATH, m_QuestCfg.award[0]));
                CmNum.text.text     = UiTools.FormateMoneyUP(m_QuestCfg.award[1]);
            }
            Tips.text.text = string.Format(Global.gApp.gGameData.GetTipsInCurLanguage(3047), m_QuestCfg.condition[1]);
            Btn1.button.onClick.AddListener(TouchClose);
            RegisterListeners();

            //直接领取
            OnReceive();

            GeneralConfigItem generalConfigItem = Global.gApp.gGameData.GeneralConfigData.Get(GeneralConfigConstVal.OPEN_BOX_DELAY_SECOND);
            int delay = int.Parse(generalConfigItem.content);

            gameObject.AddComponent <DelayCallBack>().SetAction(() =>
            {
                TouchClose();
            }, delay, true);

            base.ChangeLanguage();
        }
コード例 #15
0
        private void FreshWeek()
        {
            int curIndex             = GetShowIndex();
            List <QuestItem> configs = Global.gApp.gGameData.QuestTypeMapData[QuestConst.TYPE_LOGIN];

            for (int i = (curIndex / 7) * 7; i < (curIndex / 7 + 1) * 7; i++)
            {
                QuestItemDTO questItemDTO = Global.gApp.gSystemMgr.GetQuestMgr().GetQuestItemDTO(configs[i].quest_id);

                RectTransform_Image_Container day = ReflectionUtil.GetValueByProperty <SevenDayUI, RectTransform_Image_Container>("day" + (i % 7 + 1), this);

                //20191021 陈冬要求不读取配置图片
                //Image awardIcon = day.rectTransform.GetChild(1).GetComponent<Image>();
                //awardIcon.sprite = Global.gApp.gResMgr.LoadAssets<Sprite>(configs[i].awardIcon);

                //显示物品数目
                QuestItem config = Global.gApp.gGameData.QuestData.Get(configs[i].quest_id);

                ItemItem questAward = Global.gApp.gGameData.ItemData.Get((int)configs[i].award[0]);
                if (ItemTypeConstVal.isWeapon(questAward.showtype))
                {
                    day.rectTransform.Find("m_rewardGun").GetComponent <Image>().sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(questAward.image_grow);
                    day.rectTransform.Find("m_rewardGun").gameObject.SetActive(true);
                    day.rectTransform.Find("m_reward").gameObject.SetActive(false);
                    day.rectTransform.Find("m_Num").gameObject.SetActive(false);
                    if (questItemDTO.state == QuestStateConstVal.CAN_RECEIVE)
                    {
                        Global.gApp.gSystemMgr.GetQuestMgr().ReceiveQuest(configs[i].quest_id, 1, BehaviorTypeConstVal.OPT_SEVEN_DAY_LOGIN);
                        questItemDTO = Global.gApp.gSystemMgr.GetQuestMgr().GetQuestItemDTO(configs[i].quest_id);
                        AfLog(configs[i].quest_id);
                    }
                    Transform quality = day.rectTransform.Find("m_rewardGun").transform.Find("quality");
                    if (quality != null)
                    {
                        if (questAward.showtype == ItemTypeConstVal.BASE_MAIN_WEAPON)
                        {
                            quality.gameObject.GetComponent <Image>().sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(string.Format(CommonResourceConstVal.MAIN_UI_WEAPON_DOWN_PATH, questAward.qualevel));
                        }
                        else
                        {
                            quality.gameObject.GetComponent <Image>().sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(string.Format(CommonResourceConstVal.MAIN_UI_WEAPON_DOWN_PATH, 2));
                        }
                    }
                    Transform effect = day.rectTransform.Find("m_rewardGun").transform.Find("effect");
                    if (questItemDTO.state != QuestStateConstVal.RECEIVED && effect != null)
                    {
                        EffectItem effectItem = Global.gApp.gGameData.EffectData.Get(EffectConstVal.QUALITY);
                        string     effectName = questAward.showtype == ItemTypeConstVal.BASE_MAIN_WEAPON ? questAward.qualevel.ToString() : "common";
                        GameObject effectObj  = UiTools.GetEffect(string.Format(effectItem.path, effectName), effect);
                        effectObj.transform.GetChild(0).localPosition = new Vector3(0f, 0f, 0f);
                        ParticleSystem[] pss = effectObj.GetComponentsInChildren <ParticleSystem>();
                        foreach (ParticleSystem ps in pss)
                        {
                            ps.GetComponent <Renderer>().sortingOrder = 45;
                        }
                    }
                }
                else
                {
                    day.rectTransform.Find("m_Num").gameObject.SetActive(true);
                    day.rectTransform.Find("m_rewardGun").gameObject.SetActive(false);
                    day.rectTransform.Find("m_reward").gameObject.SetActive(true);
                }

                day.rectTransform.Find("m_Num").GetComponent <Text>().text = UiTools.FormateMoneyUP(config.award[1]);

                //已经领取
                day.rectTransform.Find("m_getMask").gameObject.SetActive(questItemDTO.state == QuestStateConstVal.RECEIVED);

                //当前框
                day.rectTransform.Find("m_current").gameObject.SetActive(i == curIndex);
                if (i == curIndex)
                {
                    m_Cur = day;
                }
                if (i == curIndex && questItemDTO.state != QuestStateConstVal.CAN_RECEIVE)
                {
                    NormalBtn.button.interactable = false;
                    AdBtn.button.interactable     = false;
                }
            }
        }
コード例 #16
0
 private void FreshSellInfo()
 {
     m_CountText.text.text = m_CurSellCount + "/" + m_MaxCount;
     m_GoldCount.text.text = UiTools.FormateMoneyUP(m_CurSellCount * m_CampRecycleItem.price * m_GoldParam);
 }
コード例 #17
0
        public void InitDetailsInfo(NpcQuestItemDTO taskItem, int taskIndex, Transform adaptNode, Action closeCallBack)
        {
            m_CloseCallBack = closeCallBack;
            m_TaskIndex     = taskIndex;
            m_FollowRectTsf.anchoredPosition = UiTools.WorldToRectPos(gameObject, adaptNode.position, m_ParentRectTsf);
            CampTasksItem campTasksItem = Global.gApp.gGameData.CampTasksConfig.Get(taskItem.npcQuestId);

            if (campTasksItem != null)
            {
                TitleText.text.text             = Global.gApp.gGameData.GetTipsInCurLanguage(campTasksItem.title);
                prNum.text.text                 = ((int)taskItem.cur).ToString() + "/" + campTasksItem.taskCondition[2].ToString();
                m_passProgress.image.fillAmount = (float)taskItem.cur / campTasksItem.taskCondition[2];


                ItemItem conditonItem = Global.gApp.gGameData.ItemData.Get((int)campTasksItem.taskCondition[1]);
                if (conditonItem != null)
                {
                    taskIcon.image.sprite = Resources.Load(conditonItem.image_grow, typeof(Sprite)) as Sprite;
                }
                else
                {
                    if (campTasksItem.taskCondition[0] == FilterTypeConstVal.KILL_ZOMBIE)
                    {
                        taskIcon.image.sprite = Resources.Load(CommonResourceConstVal.CAMP_KILL_ICON, typeof(Sprite)) as Sprite;
                    }
                    else if (campTasksItem.taskCondition[0] == FilterTypeConstVal.GET_ITEM_BY_TYPE)
                    {
                        taskIcon.image.sprite = Resources.Load(CommonResourceConstVal.CAMP_GET_TYPE_ITEM_ICON, typeof(Sprite)) as Sprite;
                    }
                    else
                    {
                        taskIcon.image.sprite = Resources.Load(CommonResourceConstVal.CAMP_KILL_ICON, typeof(Sprite)) as Sprite;
                    }
                }
                ItemItem rewardItem = Global.gApp.gGameData.ItemData.Get(int.Parse(campTasksItem.reward[0]));
                if (rewardItem != null)
                {
                    icon.image.sprite = Resources.Load(rewardItem.image_grow, typeof(Sprite)) as Sprite;
                }
                if (rewardItem.id == SpecialItemIdConstVal.GOLD)
                {
                    double          itemNum = double.Parse(campTasksItem.reward[1]);
                    Gold_paramsItem cfg     = Global.gApp.gGameData.GoldParamsConfig.Get(Global.gApp.gSystemMgr.GetBaseAttrMgr().GetLevel());
                    itemNum      *= cfg.coinParams;
                    Num.text.text = UiTools.FormateMoneyUP(itemNum);
                }
                else
                {
                    Num.text.text = UiTools.FormateMoneyUP(double.Parse(campTasksItem.reward[1]));
                }
            }
            if (taskItem.state == NpcState.UnReceived)
            {
                WaitRewardBtn.gameObject.SetActive(false);
                RewardBtn.gameObject.SetActive(true);
                RewardBtn.button.onClick.AddListener(ReceiveReward);
            }
            else
            {
                WaitRewardBtn.gameObject.SetActive(true);
                RewardBtn.gameObject.SetActive(false);
            }
        }
コード例 #18
0
ファイル: FightUi_Logic.cs プロジェクト: howelllucas/Project
 private void GoldChanged(double gold)
 {
     cointxt.text.text = UiTools.FormateMoneyUP(gold);
 }
コード例 #19
0
 private void DiamondChanged(double val)
 {
     MoneyTxt.text.text = UiTools.FormateMoneyUP(val);
 }
コード例 #20
0
 private void GoldChanged(double val)
 {
     CoinTxt.text.text = UiTools.FormateMoneyUP(val);
 }