From 34c01f30d2e26aa76a0ee0a5a06664a25ef3fe5a Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期一, 10 九月 2018 19:20:01 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/Treasure/TreasurePotentialPanel.cs |   45 +++++++++++++++++++++++++++++++++++++++------
 1 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/System/Treasure/TreasurePotentialPanel.cs b/System/Treasure/TreasurePotentialPanel.cs
index 7c7b46f..7d82eb1 100644
--- a/System/Treasure/TreasurePotentialPanel.cs
+++ b/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;
                 }

--
Gitblit v1.8.0