少年修仙传客户端代码仓库
client_linchunjie
2018-09-10 da5f19a6115f993a70654efc44cba0c63c2c4d58
3397【主干】法宝潜力表现优化
5个文件已修改
157 ■■■■ 已修改文件
System/Treasure/TreasureAnimation.cs 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasurePotentialBriefInfo.cs 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasurePotentialLines.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasurePotentialPanel.cs 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureSoulWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureAnimation.cs
@@ -48,6 +48,7 @@
        }
        #region const
        const int POTENTIALUNLOCKSFX = 5190;
        public const int SPIRALSFX = 5126;
        const int CONVERGESFX = 5127;
        public const float LINE_NORMAL_LENGTH = 187f;
@@ -81,6 +82,7 @@
        public event Action OnAchievementTweenComplete;
        public event Action<int> OnUnlockPotentialComplete;
        public event Action<int> OnPotentialLevelUpComplete;
        public event Action<int> OnPotentialLineAnimComplete;
        TreasureShowStep m_Step = TreasureShowStep.None;
        TreasureShowStep m_BeforeStep = TreasureShowStep.None;
@@ -151,29 +153,29 @@
        IEnumerator Co_PotentialLevelUp(int _index, int level)
        {
            yield return StartCoroutine(Co_PotentialSpiral(_index));
            yield return StartCoroutine(Co_PotentialSpiral(_index, SPIRALSFX));
            if (displayTreasure != model.selectedTreasure)
            {
                stepComplete = true;
                yield break;
            }
            UIEffect effect = null;
            if (level == 1)
            {
                effect = EffectMgr.Instance.PlayUIEffect(POTENTIAL_LINESFX, 2100, transform, false);
                if (effect == null)
                {
                    stepComplete = true;
                    yield break;
                }
                effect.keep = true;
                effect.maskArea = m_PotentialLineMasks[_index];
                effect.SetMask();
                yield return StartCoroutine(Co_DisplayPotentialLine(_index,effect));
            }
            //UIEffect effect = null;
            //if (level == 1)
            //{
            //    effect = EffectMgr.Instance.PlayUIEffect(POTENTIAL_LINESFX, 2100, transform, false);
            //    if (effect == null)
            //    {
            //        stepComplete = true;
            //        yield break;
            //    }
            //    effect.keep = true;
            //    effect.maskArea = m_PotentialLineMasks[_index];
            //    effect.SetMask();
            //    yield return StartCoroutine(Co_DisplayPotentialLine(_index,effect));
            //}
            if (displayTreasure != model.selectedTreasure)
            {
                StopPotentialLineEffect(effect);
                //StopPotentialLineEffect(effect);
                stepComplete = true;
                yield break;
            }
@@ -182,8 +184,34 @@
                OnPotentialLevelUpComplete(_index);
            }
            stepComplete = true;
            yield return null;
            //yield return null;
            //StopPotentialLineEffect(effect);
        }
        public void DisplayPotentialLine(int _index)
        {
            stepComplete = false;
            StartCoroutine(Co_PotentialLineAnim(_index));
        }
        IEnumerator Co_PotentialLineAnim(int _index)
        {
            UIEffect effect = EffectMgr.Instance.PlayUIEffect(POTENTIAL_LINESFX, 2100, transform, false);
            if (effect == null)
            {
                stepComplete = true;
                yield break;
            }
            effect.keep = true;
            effect.maskArea = m_PotentialLineMasks[_index];
            effect.SetMask();
            yield return StartCoroutine(Co_DisplayPotentialLine(_index, effect));
            stepComplete = true;
            StopPotentialLineEffect(effect);
            if (OnPotentialLineAnimComplete != null)
            {
                OnPotentialLineAnimComplete(_index);
            }
        }
        private void StopPotentialLineEffect(UIEffect _effect)
@@ -197,9 +225,9 @@
            }
        }
        IEnumerator Co_PotentialSpiral(int _index)
        IEnumerator Co_PotentialSpiral(int _index, int effectId)
        {
            var effect = EffectMgr.Instance.PlayUIEffect(SPIRALSFX, 2700, m_TreasurePotentials[_index].transform, false);
            var effect = EffectMgr.Instance.PlayUIEffect(effectId, 2700, m_TreasurePotentials[_index].transform, false);
            var duration = effect.duration;
            var _time = 0f;
            while (_time < duration)
@@ -252,7 +280,8 @@
        IEnumerator Co_UnlockTreasurePotential(int _index)
        {
            yield return StartCoroutine(Co_PotentialSpiral(_index));
            StartCoroutine(Co_PotentialSpiral(_index, POTENTIALUNLOCKSFX));
            yield return WaitingForSecondConst.WaitMS600;
            if (displayTreasure != model.selectedTreasure)
            {
                stepComplete = true;
@@ -765,11 +794,11 @@
                m_PotentialPointSclTweens[_index].Play();
                m_PotentialPointSclTweens[_index].SetEndState();
            }
            stepComplete = true;
            if (OnStepComplete != null)
            {
                OnStepComplete(TreasureShowStep.FirstPotential);
            }
            stepComplete = true;
        }
        private void OnEnterPotential()
System/Treasure/TreasurePotentialBriefInfo.cs
@@ -19,6 +19,7 @@
        [SerializeField] Button m_Button;
        [SerializeField] UIEffect m_PotentialSfx;
        [SerializeField] Image m_Select;
        [SerializeField] Image m_Icon;
        //[SerializeField] ScaleTween m_SelectScale;
        public TreasurePotential potential { get; private set; }
@@ -63,7 +64,8 @@
            }
            m_Level.text = _unlock ? StringUtility.Contact(_potential.level, "/", maxLevel) : string.Empty;
            m_Level.transform.localScale = Vector3.one;
            m_PotentialName.text = config.SkillName;// _unlock ? config.SkillName : string.Empty;
            DisplayName(_unlock, config);
            model.potentialLevelChangeEvent -= OnPotentialLevelUp;
            model.potentialLevelChangeEvent += OnPotentialLevelUp;
@@ -97,19 +99,30 @@
            bool _unlock = potential != null && model.IsPotentialUnlock(model.selectedTreasure, potential.id);
            m_Level.text = _unlock ? StringUtility.Contact(potential.level, "/", maxLevel) : string.Empty;
            m_Level.transform.localScale = Vector3.one;
            m_PotentialName.text = config.SkillName;// _unlock ? config.SkillName : string.Empty;
            DisplayName(_unlock, config);
        }
        void DisplayName(bool unlock, SkillConfig config)
        {
            m_PotentialName.text = config.SkillName;
            m_PotentialName.color = UIHelper.GetUIColor(TextColType.LightYellow);
            if (!unlock)
            {
                var requirement = string.Empty;
                if (config.LearnSkillReq > 0 && config.LearnSkillLV > 0)
                {
                    var preskillConfig = Config.Instance.Get<SkillConfig>(config.LearnSkillReq);
                    requirement = Language.Get("Hallows_NeedSkillLVStart", preskillConfig.SkillName, config.LearnSkillLV);
                    m_PotentialName.text = requirement;
                    m_PotentialName.color = UIHelper.GetUIColor(TextColType.Red);
                }
            }
        }
        public void OnPotentialSelected(int _potentialId)
        {
            //m_SelectScale.SetEndState();
            m_Select.gameObject.SetActive(_potentialId == potential.id);
        }
        //public void DisplaySelectSfxScale()
        //{
        //    m_SelectScale.Play();
        //}
        private void OnPotentialLevelUp(int _treasureId, int _potential)
        {
@@ -128,10 +141,12 @@
            m_PotentialSfx.loop = true;
            m_DeadPotentailTween.enabled = false;
            m_DeadPotentailTween.SetStartState();
            m_Icon.material = MaterialUtility.GetUIDefaultGraphicMaterial();
            switch (_state)
            {
                case 0:
                    m_DeadPotentailTween.enabled = true;
                    m_Icon.material = MaterialUtility.GetDefaultSpriteGrayMaterial();
                    break;
                case 1:
                    m_PotentialSfx.effect = 5128;
System/Treasure/TreasurePotentialLines.cs
@@ -29,6 +29,14 @@
                / TreasureAnimation.LINE_NORMAL_LENGTH * TreasureAnimation.LINE_NORMAL_SCALE);
            animator.Play(TreasureAnimation.POTENTIAL_LINE_STATE_2, 0, 0);
        }
        public void Dispose()
        {
            for (int i = 0; i < m_Lines.Length; i++)
            {
                m_Lines[i].StopImediatly();
            }
        }
    }
}
System/Treasure/TreasurePotentialPanel.cs
@@ -160,7 +160,10 @@
                    behaviour.gameObject.SetActive(true);
                    behaviour.treasurePotential = this;
                    behaviour.DisplayBaseInfo(m_Treasure.potentials[i], _state);
                    m_PotentialLine.Display(i, m_Treasure.potentials[i].level >= 1);
                    if (_state != 2 && m_TreasureAnimation.step == TreasureAnimation.TreasureShowStep.UnLock)
                    {
                        m_PotentialLine.Display(i, model.IsPotentialUnlock(m_Treasure.id, m_Treasure.potentials[i].id));
                    }
                }
                else
                {
@@ -220,6 +223,9 @@
            m_TreasureAnimation.OnPotentialLevelUpComplete -= OnPotentialLevelUpComplete;
            m_TreasureAnimation.OnPotentialLevelUpComplete += OnPotentialLevelUpComplete;
            m_TreasureAnimation.OnPotentialLineAnimComplete -= OnPotentialLineAnimComplete;
            m_TreasureAnimation.OnPotentialLineAnimComplete += OnPotentialLineAnimComplete;
            model.potentialBookSelectEvent -= DisplayPotentialBook;
            model.potentialBookSelectEvent += DisplayPotentialBook;
@@ -240,6 +246,8 @@
                behaviour.Dispose();
            }
            m_PotentialLine.Dispose();
            model.potentialBookSelectEvent -= DisplayPotentialBook;
            model.onPotentialLevelUpResultEvent -= OnPotentialLevelUp;
            model.potentialLevelUpdate -= PotentialLevelUpdate;
@@ -250,6 +258,7 @@
            m_TreasureAnimation.OnUnlockPotentialComplete -= OnUnlockPotentialComplete;
            m_TreasureAnimation.OnPotentialLevelUpComplete -= OnPotentialLevelUpComplete;
            RedpointCenter.Instance.redpointValueChangeEvent -= RedpointValueChangeEvent;
            m_TreasureAnimation.OnPotentialLineAnimComplete -= OnPotentialLineAnimComplete;
            m_SelectedPotential = 0;
        }
@@ -265,7 +274,6 @@
        private void OnPotentialLevelUpComplete(int _index)
        {
            var potential = m_Treasure.potentials[_index];
            m_PotentialLine.Display(_index, true);
            potentialBriefInfos[_index].DisplayStateSfx();
            potentialBriefInfos[_index].StartLevelTween();
            var _nextPotential = GetNextPotential(potential.id);
@@ -290,6 +298,15 @@
        private void OnUnlockPotentialComplete(int _index)
        {
            selectedPotential = m_Treasure.potentials[_index].id;
            m_TreasureAnimation.DisplayPotentialLine(_index);
        }
        private void OnPotentialLineAnimComplete(int _index)
        {
            if (_index < potentialBriefInfos.Length)
            {
                m_PotentialLine.Display(_index, true);
            }
        }
        private void OnStepComplete(TreasureAnimation.TreasureShowStep _step)
@@ -304,6 +321,7 @@
                        m_TreasureAnimation.UnlockTreasurePotential(0);
                        model.SetPotentialUnlockShow(model.selectedTreasure);
                    }
                    DisplayLines();
                    break;
                case TreasureAnimation.TreasureShowStep.FirstPotential:
                    if (FuncOpen.Instance.IsFuncOpen(82))
@@ -314,6 +332,25 @@
                        model.SetPotentialUnlockShow(model.selectedTreasure);
                    }
                    break;
            }
        }
        void DisplayLines()
        {
            if (m_Treasure == null)
            {
                return;
            }
            for (int i = 0; i < potentialBriefInfos.Length; i++)
            {
                if (i < m_Treasure.potentials.Count)
                {
                    m_PotentialLine.Display(i, model.IsPotentialUnlock(m_Treasure.id, m_Treasure.potentials[i].id));
                }
                else
                {
                    m_PotentialLine.Display(i, false);
                }
            }
        }
@@ -741,10 +778,6 @@
                }
                if (potentialBriefInfos[i].potential.id == id)
                {
                    if (level == 1)
                    {
                        m_PotentialLine.Display(i, false);
                    }
                    m_TreasureAnimation.DisplayPotentialLevelUp(i, level);
                    break;
                }
System/Treasure/TreasureSoulWin.cs
@@ -266,7 +266,7 @@
                        if (!model.IsCompleteLockAchievement(model.selectSoul))
                        {
                            m_Active.gameObject.SetActive(false);
                            m_GotoRealm.gameObject.SetActive(true);
                            m_GotoRealm.gameObject.SetActive(false);
                        }
                        else
                        {