少年修仙传客户端代码仓库
client_linchunjie
2018-09-25 cf0229def36f6b98c26ec2241dfbedb8eadb7693
3815【前端】法宝潜力选择和红点优化
1个文件已修改
32 ■■■■ 已修改文件
System/Treasure/TreasurePotentialPanel.cs 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasurePotentialPanel.cs
@@ -595,7 +595,7 @@
        {
            var levelUpConfig = GetPotentialLevelUpConfig();
            m_SuccessRatio.text = StringUtility.Contact((levelUpConfig.rate * 0.01f).ToString("f0"), "%");
            m_RatioUp.gameObject.SetActive(model.selectedPotentialBook != 0 && levelUpConfig.rate > 0);
            m_RatioUp.gameObject.SetActive(model.selectedPotentialBook != 0 && levelUpConfig.rate > 0 && levelUpConfig.materilaKind > 1);
            m_SuccessRatio.color = UIHelper.GetUIColor(model.selectedPotentialBook != 0 && levelUpConfig.rate > 0
                ? TextColType.DarkGreen : TextColType.LightYellow);
            m_UpgradeImage.gray = levelUpConfig.rate == 0 && model.selectedPotentialBook == 0;
@@ -622,14 +622,25 @@
        private void OnSpNeedItem()
        {
            var levelUpConfig = GetPotentialLevelUpConfig();
            if (levelUpConfig.rate < 10000 || model.selectedPotentialBook != 0)
            if (levelUpConfig.rate >= 10000)
            {
                SysNotifyMgr.Instance.ShowTip("SPSuccessHint");
                return;
            }
            if (model.selectedPotentialBook == 0)
            {
                WindowCenter.Instance.Open<PotentialItemUseWin>();
            }
            else
            {
                SysNotifyMgr.Instance.ShowTip("SPSuccessHint");
                //DesignDebug.Log("成功率已经够高了,不需要再增加概率了!");
                if (levelUpConfig.materilaKind > 1)
                {
                    WindowCenter.Instance.Open<PotentialItemUseWin>();
                }
                else
                {
                    ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(model.selectedPotentialBook);
                }
            }
        }
@@ -642,7 +653,7 @@
        {
            m_PotentialBook.gameObject.SetActive(_potentialBookId != 0);
            m_PotentialCount.gameObject.SetActive(_potentialBookId != 0);
            m_RemoveBook.gameObject.SetActive(_potentialBookId != 0);
            m_RemoveBook.gameObject.SetActive(false);
            m_AddBookSign.gameObject.SetActive(_potentialBookId == 0);
            if (_potentialBookId != 0)
            {
@@ -653,6 +664,7 @@
                bool satisfy = levelUpConfig.own >= levelUpConfig.need;
                m_PotentialCount.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(satisfy ?
                    TextColType.LightYellow : TextColType.Red, levelUpConfig.own.ToString()), "/", levelUpConfig.need);
                m_RemoveBook.gameObject.SetActive(levelUpConfig.materilaKind > 1);
            }
            DisplaySuccessRatio();
@@ -762,11 +774,11 @@
            var config = Config.Instance.Get<TreasureSkillConfig>(levelupId);
            if (config == null)
            {
                return new PotentialLevelUpConfig(0, 0, 0, 0);
                return new PotentialLevelUpConfig(0, 0, 0, 0, 0);
            }
            if (model.selectedPotentialBook == 0)
            {
                return new PotentialLevelUpConfig(config.InitialRate, 0, 0, 0);
                return new PotentialLevelUpConfig(config.InitialRate, 0, 0, 0, 0);
            }
            else
            {
@@ -784,7 +796,7 @@
                var need = config.MeterialNum2[index];
                var ratio = own >= need ? config.Rate[index] : config.InitialRate;
                return new PotentialLevelUpConfig(ratio, index + 1, own, need);
                return new PotentialLevelUpConfig(ratio, index + 1, own, need, config.Meterial2ID.Length);
            }
        }
@@ -1050,13 +1062,15 @@
            public int rate;
            public int need;
            public int own;
            public int materilaKind;
            public PotentialLevelUpConfig(int _rate, int _materilaIndex, int _own, int _need)
            public PotentialLevelUpConfig(int _rate, int _materilaIndex, int _own, int _need,int materilaKind)
            {
                this.rate = _rate;
                this.materilaIndex = _materilaIndex;
                this.need = _need;
                this.own = _own;
                this.materilaKind = materilaKind;
            }
        }
        [Serializable]