Esempio n. 1
0
        public virtual void ChangeLanguage()
        {
            string lgg = Global.gApp.gSystemMgr.GetMiscMgr().Language;

            if (lgg == null || lgg.Equals(GameConstVal.EmepyStr))
            {
                lgg = UiTools.GetLanguage();
            }
            if (!lgg.Equals(m_Language))
            {
                m_Language = lgg;
                Text[] ts = gameObject.GetComponentsInChildren <Text>(true);
                foreach (Text t in ts)
                {
                    t.font = Global.gApp.gGameData.GetFont(lgg);
                    if (UiTools.IsNumeric(t.text))
                    {
                        continue;
                    }
                    LanguageTip lt = t.GetComponent <LanguageTip>();
                    if (lt != null)
                    {
                        //Debug.Log(t.text + " use tip = " + lt.TipId);
                        t.text = Global.gApp.gGameData.GetTipsInCurLanguage(lt.TipId);
                    }
                    else
                    {
                        //Debug.Log("text = " + t.text + ", don't add component LanguageTip");
                    }
                }
            }
        }
Esempio n. 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);
        }
Esempio n. 3
0
 protected void AdapterName(string itemName)
 {
     if (m_NameMesh == null)
     {
         m_NameMesh = transform.Find(GameConstVal.TextMeshName);
     }
     if (m_NameMesh != null)
     {
         ItemItem itemCfg = Global.gApp.gGameData.GetItemDataByName(itemName);
         if (itemCfg != null)
         {
             TextMesh textMesh = m_NameMesh.GetComponent <TextMesh>();
             string   lgg      = Global.gApp.gSystemMgr.GetMiscMgr().Language;
             if (lgg == null || lgg.Equals(GameConstVal.EmepyStr))
             {
                 lgg = UiTools.GetLanguage();
             }
             textMesh.text = Global.gApp.gGameData.GetTipsInCurLanguage(itemCfg.sourceLanguage);
             textMesh.font = Global.gApp.gGameData.GetFont(lgg);
             MeshRenderer meshRenderer = m_NameMesh.GetComponent <MeshRenderer>();
             if (meshRenderer != null)
             {
                 meshRenderer.sharedMaterial = textMesh.font.material;
             }
         }
     }
 }
Esempio n. 4
0
        public void Init(NpcQuestItemDTO questItem, Transform followNode, Action action)
        {
            m_FollowNode.SetFloowNode(followNode);
            gameObject.AddComponent <DelayCallBack>().SetAction(action, 2, true);
            int         state   = questItem.state;
            CampNpcItem npcItem = Global.gApp.gGameData.CampNpcConfig.Get(questItem.npcId);

            if (state == NpcState.None)
            {
                int plotLength = npcItem.NoTask.Length;
                int plotIndex  = UnityEngine.Random.Range(0, plotLength);
                TaskText.text.text = Global.gApp.gGameData.GetTipsInCurLanguage(npcItem.NoTask[plotIndex]);
            }
            else if (state == NpcState.Received)
            {
                int plotLength = npcItem.TaskFinished.Length;
                int plotIndex  = UnityEngine.Random.Range(0, plotLength);
                TaskText.text.text = Global.gApp.gGameData.GetTipsInCurLanguage(npcItem.NoTask[plotIndex]);
            }
            string lgg = Global.gApp.gSystemMgr.GetMiscMgr().Language;

            if (lgg == null || lgg.Equals(GameConstVal.EmepyStr))
            {
                lgg = UiTools.GetLanguage();
            }
            TaskText.text.font = Global.gApp.gGameData.GetFont(lgg);
        }
        private void InitNode()
        {
            CampShopItem campShopItem = m_ItemUI.GetCampItem();

            CloseBtn.button.onClick.AddListener(TouchClose);

            ItemItem itemItem = Global.gApp.gGameData.ItemData.Get(campShopItem.propId);

            Debug.Log(itemItem.image_grow);
            MatIcon.image.sprite = Resources.Load(itemItem.image_grow, typeof(Sprite)) as Sprite;
            MatName.text.text    = Global.gApp.gGameData.GetTipsInCurLanguage(itemItem.sourceLanguage);
            GeneralConfigItem colorConfig = Global.gApp.gGameData.GeneralConfigData.Get(GeneralConfigConstVal.QUALITY_COLOR);

            if (itemItem.showtype == ItemTypeConstVal.BASE_MAIN_WEAPON)
            {
                bgBottom.image.sprite = Resources.Load(string.Format(CommonResourceConstVal.MAIN_UI_WEAPON_DOWN_PATH, itemItem.qualevel), typeof(Sprite)) as Sprite;
                MatName.text.color    = ColorUtil.GetColor(colorConfig.contents[itemItem.qualevel]);
            }
            else
            {
                bgBottom.image.sprite = Resources.Load(string.Format(CommonResourceConstVal.MAIN_UI_WEAPON_DOWN_PATH, 2), typeof(Sprite)) as Sprite;
                MatName.text.color    = ColorUtil.GetColor(colorConfig.contents[2]);
            }
            EffectItem effectItem = Global.gApp.gGameData.EffectData.Get(EffectConstVal.QUALITY);
            string     effectName = itemItem.showtype == ItemTypeConstVal.BASE_MAIN_WEAPON ? itemItem.qualevel.ToString() : "common";
            GameObject effect     = UiTools.GetEffect(string.Format(effectItem.path, effectName), EffectPos.rectTransform);

            effect.transform.localPosition             = new Vector3(0f, 0f, 0f);
            effect.transform.GetChild(0).localPosition = new Vector3(0f, 0f, 0f);
            ParticleSystem[] pss = effect.GetComponentsInChildren <ParticleSystem>();
            foreach (ParticleSystem ps in pss)
            {
                ps.GetComponent <Renderer>().sortingOrder = 51;
            }
        }
Esempio n. 6
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();
        }
Esempio n. 7
0
 private void CreateAppear()
 {
     if (m_Appear == null)
     {
         if (m_ChipGainType == ChipGainType.AutoGain)
         {
             m_Appear     = Global.gApp.gResMgr.InstantiateObj(EffectConfig.EffectPath[EffectConfig.WpnChipAppearAutoGain]);
             m_AppearTail = Global.gApp.gResMgr.InstantiateObj(EffectConfig.EffectPath[EffectConfig.WpnChipAppearAutoGainTail]);
             m_AppearTail.transform.SetParent(transform, false);
             transform.Find(GameConstVal.TextMeshName).gameObject.SetActive(false);
             FightUI fightUi = Global.gApp.gUiMgr.GetPanelCompent <FightUI>(Wndid.FightPanel);
             if (fightUi != null)
             {
                 RectTransform rext = fightUi.GetChipIconRectTsf();
                 m_DestPos = rext.position;
             }
             else
             {
                 m_DestPos = Vector3.zero;
             }
             Vector3 screenPoint = Camera.main.WorldToScreenPoint(transform.position);
             transform.position = UiTools.ScreenToUiWorld(screenPoint);
             m_StartPos         = transform.position;
             AddChip();
         }
         else
         {
             m_Appear = Global.gApp.gResMgr.InstantiateObj(EffectConfig.EffectPath[EffectConfig.WpnChipAppearTriggerGain]);
         }
         m_Appear.transform.SetParent(transform, false);
     }
 }
Esempio n. 8
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();
        }
        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);
        }
Esempio n. 10
0
 private void FollowMonster()
 {
     if (m_FollwNode)
     {
         m_FollowRectTsf.anchoredPosition = UiTools.WorldToRectPos(gameObject, m_FollwNode.position, m_ParentRectTsf);
     }
 }
Esempio n. 11
0
 private void CampRewardChanged(double val)
 {
     if (!m_idEndLock[GoodsType.CAMPSITE_REWARD])
     {
         return;
     }
     AssetChangeImp(CampRewardTxt.text, UiTools.FormateMoney(val));
 }
Esempio n. 12
0
 private void DiamondChanged(double val)
 {
     if (!m_idEndLock[GoodsType.DIAMOND])
     {
         return;
     }
     AssetChangeImp(DiamondTxt.text, UiTools.FormateMoney(val));
 }
Esempio n. 13
0
        private void RefreshData(int dataIndex)
        {
            if (pointDataMgr != null && dataIndex != pointDataMgr.index)
            {
                return;
            }
            LvTxt.text.text       = string.Format("Lv.{0}", pointDataMgr.Lv);
            RewardTxt.text.text   = UiTools.FormateMoney(pointDataMgr.OnceRewardVal);
            IntervalTxt.text.text = LanguageMgr.GetText("CampDetail_Text_Time", pointDataMgr.RewardInterval);
            AutoTipTxt.text.text  = LanguageMgr.GetText("CampDetail_Tips_Auto", pointDataMgr.AutoLv);
            if (pointDataMgr.isAuto)
            {
                UIGray.Recovery(AutoIcon.image);
                AutoTxt.text.text     = LanguageMgr.GetText("CampDetail_Rule_AutoOpen");
                AutoTxt.text.color    = Color.green;
                AutoTipTxt.text.color = Color.green;
                DescTxt.text.text     = LanguageMgr.GetText("CampDetail_Text_Upgrade");
            }
            else
            {
                UIGray.SetUIGray(AutoIcon.image);
                AutoTxt.text.text     = LanguageMgr.GetText("CampDetail_Rule_AutoClose");
                AutoTxt.text.color    = Color.red;
                AutoTipTxt.text.color = Color.red;
                if (pointDataMgr.equipGunId > 0)
                {
                    DescTxt.text.text = LanguageMgr.GetText("CampDetail_Text_NOAuto");
                }
                else
                {
                    DescTxt.text.text = LanguageMgr.GetText("CampDetail_Text_NoWeapon");
                }
            }

            var lvUpCost = pointDataMgr.GetLvUpCost(1);

            CostTxt.text.text = UiTools.FormateMoney(lvUpCost);
            if (lvUpCost <= CampsiteMgr.singleton.TotalRewardVal)
            {
                CostTxt.text.color = Color.white;
            }
            else
            {
                CostTxt.text.color = Color.red;
            }

            if (pointDataMgr.equipGunId > 0)
            {
                CardData.gameObject.SetActive(true);
                CardData.GunUI_GunCard.Init(TableMgr.singleton.GunCardTable.GetItemByID(pointDataMgr.equipGunId));
                SetGunTxt.text.text = LanguageMgr.GetText("CampDetail_Button_Change");
            }
            else
            {
                CardData.gameObject.SetActive(false);
                SetGunTxt.text.text = LanguageMgr.GetText("CampDetail_Button_Equi");
            }
        }
Esempio n. 14
0
        public override void Init <T>(string name, UIInfo info, T arg)
        {
            base.Init(name, info, arg);
            var pointDataMgr = arg as CampsitePointMgr;

            Title.text.text = pointDataMgr.buildingRes.buildingName;
            RewardBase.CampDetailItem.SetValue(UiTools.FormateMoney(pointDataMgr.RewardBase));
            RewardPlayer.CampDetailItem.SetTitle(LanguageMgr.GetText("CampDetail_Rule_Rank", PlayerDataMgr.singleton.GetPlayerLevel()));
            RewardPlayer.CampDetailItem.SetValue(string.Format("x{0}", pointDataMgr.RewardFactorByPlayer));
            RewardSettleTxt.text.text = UiTools.FormateMoney(pointDataMgr.OnceRewardVal);
            IntervalBase.CampDetailItem.SetValue(LanguageMgr.GetText("CampDetail_Text_Time", pointDataMgr.RewardIntervalBase));
            IntervalSettleTxt.text.text = LanguageMgr.GetText("CampDetail_Text_Time", pointDataMgr.RewardInterval);
            CostBase.CampDetailItem.SetValue(UiTools.FormateMoney(pointDataMgr.LvUpCostBase));
            CostSettleTxt.text.text = UiTools.FormateMoney(pointDataMgr.GetLvUpCost(1));
            string autoColorHex = ColorUtility.ToHtmlStringRGB(pointDataMgr.isAuto ? Color.green : Color.red);

            AutoSettleTxt.text.color = pointDataMgr.isAuto ? Color.green : Color.red;
            AutoSettleTxt.text.text  = LanguageMgr.GetText(pointDataMgr.isAuto ? "CampDetail_Rule_AutoOpen" : "CampDetail_Rule_AutoClose");

            if (pointDataMgr.equipGunId > 0)
            {
                var gunRes     = TableMgr.singleton.GunCardTable.GetItemByID(pointDataMgr.equipGunId);
                var cardSprite = Global.gApp.gResMgr.LoadAssets <Sprite>(gunRes.icon);
                RewardCardBase.CampDetailItem.SetIcon(cardSprite);
                RewardCardBase.CampDetailItem.SetValue(string.Format("x{0}", pointDataMgr.RewardFactorByCardBase));
                var rewardFactorByCardSkill = pointDataMgr.RewardFactorByCardSkill;
                if (rewardFactorByCardSkill > 1)
                {
                    RewardCardSkill.CampDetailItem.SetIcon(cardSprite);
                    RewardCardSkill.CampDetailItem.SetValue(string.Format("x{0}", rewardFactorByCardSkill));
                }
                else
                {
                    RewardCardSkill.gameObject.SetActive(false);
                }

                var intervalFactorByCardSkill = pointDataMgr.RewardIntervalFactorByCardSkill;
                if (intervalFactorByCardSkill > 1)
                {
                    IntervalCardSkill.CampDetailItem.SetIcon(cardSprite);
                    IntervalCardSkill.CampDetailItem.SetValue(string.Format("x{0}", intervalFactorByCardSkill));
                }
                else
                {
                    IntervalCardSkill.gameObject.SetActive(false);
                }
                var gunLv = PlayerDataMgr.singleton.GetCardLevel(pointDataMgr.equipGunId);
                AutoCardLv.CampDetailItem.SetValue(string.Format("<color=#{0}>{1}</color>/{2}", autoColorHex, gunLv, pointDataMgr.AutoLv));
            }
            else
            {
                RewardCardBase.gameObject.SetActive(false);
                RewardCardSkill.gameObject.SetActive(false);
                IntervalCardSkill.gameObject.SetActive(false);
                AutoCardLv.CampDetailItem.SetValue(string.Format("<color=#{0}>{1}</color>/{2}", autoColorHex, 0, pointDataMgr.AutoLv));
            }
        }
Esempio n. 15
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);
        }
Esempio n. 16
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();
        }
Esempio n. 17
0
        public void SetPlotId(int plotId)
        {
            TaskText.text.text = Global.gApp.gGameData.GetTipsInCurLanguage(plotId);
            string lgg = Global.gApp.gSystemMgr.GetMiscMgr().Language;

            if (lgg == null || lgg.Equals(GameConstVal.EmepyStr))
            {
                lgg = UiTools.GetLanguage();
            }
            TaskText.text.font = Global.gApp.gGameData.GetFont(lgg);
        }
Esempio n. 18
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);
        }
Esempio n. 19
0
        public void ShowText(string text)
        {
            Plottxt.text.text = text;
            string lgg = Global.gApp.gSystemMgr.GetMiscMgr().Language;

            if (lgg == null || lgg.Equals(GameConstVal.EmepyStr))
            {
                lgg = UiTools.GetLanguage();
            }
            Plottxt.text.font = Global.gApp.gGameData.GetFont(lgg);
        }
Esempio n. 20
0
        private void ShowTextImp(string text)
        {
            TipsText.text.text = text;
            string lgg = Global.gApp.gSystemMgr.GetMiscMgr().Language;

            if (lgg == null || lgg.Equals(GameConstVal.EmepyStr))
            {
                lgg = UiTools.GetLanguage();
            }
            TipsText.text.font = Global.gApp.gGameData.GetFont(lgg);
            Destroy(gameObject, 1);
        }
Esempio n. 21
0
        public override void Init <T>(string name, UIInfo info, T arg)
        {
            base.Init(name, info, arg);
            m_NpcBehavior = arg as NpcBehavior;
            Canvas        parentCanvas  = GetComponentInParent <Canvas>();
            RectTransform parentRectTsf = parentCanvas.GetComponent <RectTransform>();

            m_AdaptNode.rectTransform.anchoredPosition = UiTools.WorldToRectPos(gameObject, m_NpcBehavior.GetTaskUINode().position, parentRectTsf);
            GenerateRecycleMat();
            InitNode();
            base.ChangeLanguage();
        }
Esempio n. 22
0
        private void CheckPointDataChange()
        {
            var curRewardVal = pointDataMgr.OnceRewardVal;
            var curInterval  = pointDataMgr.RewardInterval;
            var curIsAuto    = pointDataMgr.isAuto;
            var curLvUpCost  = pointDataMgr.GetLvUpCost(1);

            bool hasChange = false;

            if (curRewardVal != lastRewardVal)
            {
                RewardChangeItem.CampsitePointUI_DataChangeItem.Init
                    (UiTools.FormateMoney(lastRewardVal), UiTools.FormateMoney(curRewardVal), curRewardVal > lastRewardVal);
                RewardChangeItem.gameObject.SetActive(true);
                hasChange = true;
            }
            else
            {
                RewardChangeItem.gameObject.SetActive(false);
            }
            if (curInterval != lastInterval)
            {
                IntervalChangeItem.CampsitePointUI_DataChangeItem.Init
                    (LanguageMgr.GetText("CampDetail_Text_Time", lastInterval), LanguageMgr.GetText("CampDetail_Text_Time", curInterval), curInterval < lastInterval);
                IntervalChangeItem.gameObject.SetActive(true);
                hasChange = true;
            }
            else
            {
                IntervalChangeItem.gameObject.SetActive(false);
            }
            if (curIsAuto != lastIsAuto)
            {
                AutoChangeItem.CampsitePointUI_DataChangeItem.Init
                    (LanguageMgr.GetText(lastIsAuto ? "CampDetail_Rule_AutoOpen" : "CampDetail_Rule_AutoClose"),
                    LanguageMgr.GetText(curIsAuto ? "CampDetail_Rule_AutoOpen" : "CampDetail_Rule_AutoClose"),
                    curIsAuto);
                AutoChangeItem.gameObject.SetActive(true);
                hasChange = true;
            }
            else
            {
                AutoChangeItem.gameObject.SetActive(false);
            }

            if (hasChange)
            {
                StopAllCoroutines();
                StartCoroutine(ShowChangeDataPanelIE());
            }
        }
Esempio n. 23
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();
        }
Esempio n. 24
0
        private void InitNextUI(QuestItemDTO nextLevelDetailDTO, ItemItem itemConfig)
        {
            bool isWeapon = ItemTypeConstVal.isWeapon(itemConfig.showtype);

            //NextGunName.gameObject.SetActive(isWeapon);
            LDAGunIcon.gameObject.SetActive(itemConfig.showtype == ItemTypeConstVal.BASE_MAIN_WEAPON);
            LDASubWpIcon.gameObject.SetActive(itemConfig.showtype == ItemTypeConstVal.SUB_WEAPON);
            LDAPetIcon.gameObject.SetActive(itemConfig.showtype == ItemTypeConstVal.PET);
            LDAAwardIcon.gameObject.SetActive(!isWeapon);
            List <GameObject> toDeleteList = new List <GameObject>();

            LDAGunEffect.image.enabled = false;
            if (isWeapon)
            {
                GeneralConfigItem colorConfig = Global.gApp.gGameData.GeneralConfigData.Get(GeneralConfigConstVal.QUALITY_COLOR);
                //NextGunName.text.color = ColorUtil.GetColor(colorConfig.contents[itemConfig.qualevel]);
                LDAGunName.text.text = FilterFactory.GetInstance().GetTinyUnfinishTips(itemConfig.opencondition);

                LDAGunIcon.image.sprite = Resources.Load(itemConfig.image_grow, typeof(Sprite)) as Sprite;

                LDASubWpIcon.image.sprite = Resources.Load(itemConfig.image_grow, typeof(Sprite)) as Sprite;

                LDAPetIcon.image.sprite = Resources.Load(itemConfig.image_grow, typeof(Sprite)) as Sprite;

                if (itemConfig.showtype == ItemTypeConstVal.BASE_MAIN_WEAPON)
                {
                    LDAGunDown.image.sprite = Resources.Load(string.Format(CommonResourceConstVal.MAIN_UI_WEAPON_DOWN_PATH, itemConfig.qualevel), typeof(Sprite)) as Sprite;
                }
                else
                {
                    LDAGunDown.image.sprite = Resources.Load(string.Format(CommonResourceConstVal.MAIN_UI_WEAPON_DOWN_PATH, 2), typeof(Sprite)) as Sprite;
                }

                if (LDAGunEffect.rectTransform.childCount == 0)
                {
                    EffectItem effectItem = Global.gApp.gGameData.EffectData.Get(EffectConstVal.QUALITY);
                    string     effectName = itemConfig.showtype == ItemTypeConstVal.BASE_MAIN_WEAPON ? itemConfig.qualevel.ToString() : "common";
                    GameObject effect     = UiTools.GetEffect(string.Format(effectItem.path, effectName), LDAGunEffect.rectTransform);

                    effect.transform.GetChild(0).localPosition = new Vector3(0f, 0f, 0f);
                }
            }
            else
            {
                QuestItem questCfg = Global.gApp.gGameData.QuestData.Get(nextLevelDetailDTO.id);
                LDAGunName.text.text      = FilterFactory.GetInstance().GetTinyUnfinishTips(questCfg.condition);
                LDAAwardIcon.image.sprite = Resources.Load(questCfg.awardIcon, typeof(Sprite)) as Sprite;
                LDAGunDown.image.sprite   = Resources.Load(string.Format(CommonResourceConstVal.MAIN_UI_WEAPON_DOWN_PATH, 2), typeof(Sprite)) as Sprite;
            }
        }
Esempio n. 25
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);
        }
Esempio n. 26
0
        public void Init(Transform adaptNode, int npcIndex, Action <int, GunCard_TableItem, bool, bool> callback)
        {
            m_NpcIndex = npcIndex;
            m_Callback = callback;
            pointData  = CampsiteMgr.singleton.GetPointByIndex(npcIndex);
            GunCard_TableItem gunData = null;

            if (pointData.equipGunId > 0)
            {
                gunData = TableMgr.singleton.GunCardTable.GetItemByID(pointData.equipGunId);
            }
            InitWeaponDropDown(pointData.buildingRes.gunType);
            SetTestValues(gunData, false, false);
            m_TitleText.text.text = string.Format("npc{0}, lv{1}", npcIndex + 1, pointData.Lv);
            m_TaskAdaptNode.rectTransform.anchoredPosition = UiTools.WorldToRectPos(gameObject, adaptNode.position, m_CanvasRect);
        }
Esempio n. 27
0
        private void RefreshData(bool refreshUI)
        {
            if (campPointMgr == null)
            {
                return;
            }

            double rewardFactor;
            float  intervalFactor;

            campPointMgr.GetCardTotalFactorOnPoint(cardId, out rewardFactor, out intervalFactor);

            bool auto = campPointMgr.CheckCardIsAuto(cardId);

            if (refreshUI)
            {
                RewardFactorBefore.text.text = string.Format("x{0}", UiTools.FormateMoney(recordRewardFactor));
                RewardFactorCur.text.text    = string.Format("x{0}", UiTools.FormateMoney(rewardFactor));

                if (auto != recordAuto)
                {
                    AutoDataChange.gameObject.SetActive(true);
                    AutoData.gameObject.SetActive(false);
                    AutoValBefore.text.text = LanguageMgr.GetText(recordAuto ? "CardPage_Tips_Open" : "CardPage_Tips_Close");
                    AutoValCur.text.text    = LanguageMgr.GetText(auto ? "CardPage_Tips_Open" : "CardPage_Tips_Close");
                }
                else
                {
                    AutoDataChange.gameObject.SetActive(false);
                    AutoData.gameObject.SetActive(true);
                    if (auto)
                    {
                        AutoVal.text.text = LanguageMgr.GetText("CardPage_Tips_Open");
                        AutoLvTip.gameObject.SetActive(false);
                    }
                    else
                    {
                        AutoVal.text.text   = LanguageMgr.GetText("CardPage_Tips_Close");
                        AutoLvTip.text.text = LanguageMgr.GetText("CardPage_Tips_Tips", campPointMgr.AutoLv);
                        AutoLvTip.gameObject.SetActive(true);
                    }
                }
            }

            recordRewardFactor = rewardFactor;
            recordAuto         = auto;
        }
        private void Deal4Level(ItemItem itemConfig)
        {
            m_ItemConfig = itemConfig;
            int gunLevel     = Global.gApp.gSystemMgr.GetWeaponMgr().GetWeaponLevel(itemConfig.name);
            int gunShowLevel = Global.gApp.gSystemMgr.GetWeaponMgr().GetWeaponShowLevel(itemConfig.name);

            WeaponLvTxt.text.text = "lv: " + gunShowLevel;
            Guns_dataItem weaponLevelData = Global.gApp.gGameData.GunDataConfig.Get(gunLevel);

            double[] paramValue;
            if (Global.gApp.gSystemMgr.GetWeaponMgr().GetQualityLv(m_ItemConfig) == 0)
            {
                paramValue = ReflectionUtil.GetValueByProperty <Guns_dataItem, double[]>(itemConfig.name, weaponLevelData);
                double showVal = itemConfig.showParam / itemConfig.dtime * paramValue[0];
                Param1Txt.text.text = UiTools.FormateMoney(showVal);
            }
            else
            {
                paramValue = ReflectionUtil.GetValueByProperty <Guns_dataItem, double[]>(itemConfig.name + "_super", weaponLevelData);
                double showVal = itemConfig.showParam / itemConfig.dtime * paramValue[0];
                Param1Txt.text.text = UiTools.FormateMoney(showVal);
            }
            m_WeaponName = itemConfig.name;
            int m_QualityLevel            = itemConfig.qualevel;
            GeneralConfigItem colorConfig = Global.gApp.gGameData.GeneralConfigData.Get(GeneralConfigConstVal.QUALITY_COLOR);

            WeaponNameTxt.text.color = ColorUtil.GetColor(colorConfig.contents[m_QualityLevel]);
            WeaponBg.image.sprite    = Resources.Load(string.Format(CommonResourceConstVal.WEAPON_BG_PATH, m_QualityLevel), typeof(Sprite)) as Sprite;

            if (m_QualityLevel > 0)
            {
                EffectItem effectItem = Global.gApp.gGameData.EffectData.Get(EffectConstVal.QUALITY);
                GameObject effect     = UiTools.GetEffect(string.Format(effectItem.path, m_QualityLevel), transform);
                if (mEffect != null)
                {
                    GameObject.Destroy(mEffect);
                }
                mEffect = effect;
                mEffect.transform.SetParent(WeaponIcon.rectTransform, true);
                if (m_IconParentNode == null)
                {
                    m_IconParentNode = WeaponIcon.gameObject.transform.parent;
                    WeaponIcon.gameObject.GetComponent <WeaponUI_Item_Follow>().SetFollowNode(m_IconParentNode);
                    WeaponIcon.gameObject.transform.SetParent(m_Parent.GetViewPoint2().transform, true);
                }
            }
        }
Esempio n. 29
0
 private void SetConsumeCoin()
 {
     m_ComsumeItem = Global.gApp.gSystemMgr.GetSkillMgr().GetSkillUpdateItem();
     CmIcon.gameObject.SetActive(m_ComsumeItem != null);
     CmNum.gameObject.SetActive(m_ComsumeItem != null);
     Maxtxt.gameObject.SetActive(m_ComsumeItem == null);
     dotxt.gameObject.SetActive(m_ComsumeItem != null);
     if (m_ComsumeItem != null)
     {
         int itemId = m_ComsumeItem.itemId;
         CmIcon.gameObject.SetActive(true);
         CmIcon.image.sprite = Global.gApp.gResMgr.LoadAssets <Sprite>(string.Format(CommonResourceConstVal.RESOURCE_PATH, itemId));
         CmNum.text.text     = UiTools.FormateMoney(m_ComsumeItem.num);
         CmNum.text.color    = ColorUtil.GetTextColor(GameItemFactory.GetInstance().GetItem((int)m_ComsumeItem.itemId) < m_ComsumeItem.num,
                                                      Global.gApp.gGameData.GeneralConfigData.Get(GeneralConfigConstVal.YELLOW_COLOR).content);
     }
 }
        public override void Init <T>(string name, UIInfo info, T arg)
        {
            base.Init(name, info, arg);
            ClaimBtn.button.onClick.AddListener(OnClaimBtnClick);
            double dt; double reward;

            if (CampsiteMgr.singleton.CheckOfflineReward(out dt, out reward))
            {
                RewardValTxt.text.text = UiTools.FormateMoney(reward);
                TimeSpan ts = new TimeSpan((long)(10000000 * dt));
                OfflineTimeTxt.text.text      = string.Format("{0:00}:{1:00}:{2:00}", (int)ts.TotalHours, ts.Minutes, ts.Seconds);
                OfflineTimeBar.slider.value   = Mathf.Clamp01((float)(dt / (CampsiteMgr.singleton.GetMaxOfflineHour() * 60 * 60)));
                MinHourTxt.text.text          = "0";
                MaxHourTxt.text.text          = LanguageMgr.GetText("IdelPage_Text_MaxTime", CampsiteMgr.singleton.GetMaxOfflineHour());
                MaxDurationDocTxt.text.text   = LanguageMgr.GetText("IdelPage_Text_Tips", CampsiteMgr.OFFLINE_HOUR_EACH_CARD);
                CollectCardCountTxt.text.text = LanguageMgr.GetText("IdelPage_Text_Number", PlayerDataMgr.singleton.GetCollectCardCount());
            }
        }