From ea7fad6e91c74f7e1e7f8540912dfbb388686612 Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期五, 15 三月 2019 11:12:58 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/Realm/RealmWin.cs                |   12 ++++--
 System/Realm/RealmStageBehaviour.cs     |   14 +++++++
 Fight/Actor/State/SMB/Dead_4.cs         |    8 ++--
 System/Realm/RealmAnimationBehaviour.cs |   30 ++++++++++----
 4 files changed, 47 insertions(+), 17 deletions(-)

diff --git a/Fight/Actor/State/SMB/Dead_4.cs b/Fight/Actor/State/SMB/Dead_4.cs
index 27c852a..94a7300 100644
--- a/Fight/Actor/State/SMB/Dead_4.cs
+++ b/Fight/Actor/State/SMB/Dead_4.cs
@@ -167,10 +167,10 @@
 
         owner.needSyncGroundHeight = true;
 
-        //if (owner.ActorType == GameObjType.gotNPC)
-        //{
-        //    GAMgr.Instance.Release(owner);
-        //}
+        if (owner is GA_NpcClientFightNorm)
+        {
+            GAMgr.Instance.Release(owner);
+        }
 
 #if UNITY_EDITOR
         string _content = string.Format("Dead_4 => {0} 閫�鍑轰簡Dead鐘舵��", owner.ServerInstID);
diff --git a/System/Realm/RealmAnimationBehaviour.cs b/System/Realm/RealmAnimationBehaviour.cs
index 813ff8c..efb3f78 100644
--- a/System/Realm/RealmAnimationBehaviour.cs
+++ b/System/Realm/RealmAnimationBehaviour.cs
@@ -35,6 +35,10 @@
                 m_RealmStages[i].transform.localPosition = GetPointPosition(i);
                 m_RealmStages[i].animIndex = i;
             }
+            foreach (var effectLine in m_EffectLines)
+            {
+                effectLine.StopImediatly();
+            }
             m_ContainerEffectLine.localEulerAngles = Vector3.zero;
             DisplayEffectLines();
         }
@@ -51,9 +55,9 @@
                     var level = realms[i] + 1;
                     if (realmLevel >= level)
                     {
-                       // m_EffectLines[i].Play();
-                       // var animator = m_EffectLines[i].target.GetAnimator();
-                       // animator.Play("idle", 0);
+                        m_EffectLines[i].Play();
+                        var animator = m_EffectLines[i].target.GetAnimator();
+                        animator.Play("idle", 0, 0);
                     }
                 }
             }
@@ -88,11 +92,14 @@
             {
                 yield break;
             }
-            //m_EffectLines[index].Play();
-            //var animator = m_EffectLines[index].target.GetAnimator();
-            //animator.Play("open", 0, 0);
-            //yield return WaitingForSecondConst.WaitMS1500;
-            //animator.Play("idle", 0);
+            if (index != -1)
+            {
+                m_EffectLines[index].Play();
+                var animator = m_EffectLines[index].target.GetAnimator();
+                animator.Play("open", 0, 0);
+                yield return WaitingForSecondConst.WaitMS500;
+                animator.Play("idle", 0);
+            }
             var realmStage = GetRealmStageBeha(index + 1);
             if (realmStage != null)
             {
@@ -161,8 +168,9 @@
                 {
                     foreach (var realmStage in m_RealmStages)
                     {
-                        if (realmStage.animIndex == 0)
+                        if (realmStage.animIndex == 0 || realmStage.animIndex == 1)
                         {
+                            realmStage.Dispose();
                             realmStage.gameObject.SetActive(false);
                         }
                         else
@@ -186,6 +194,10 @@
             m_ContainerLine.gameObject.SetActive(false);
             foreach (var realmStage in m_RealmStages)
             {
+                if (realmStage.animIndex == 1)
+                {
+                    realmStage.gameObject.SetActive(true);
+                }
                 realmStage.animIndex = (realmStage.animIndex + 5) % 9;
             }
 
diff --git a/System/Realm/RealmStageBehaviour.cs b/System/Realm/RealmStageBehaviour.cs
index 487bbdc..7f91301 100644
--- a/System/Realm/RealmStageBehaviour.cs
+++ b/System/Realm/RealmStageBehaviour.cs
@@ -69,13 +69,27 @@
                 if (animator != null)
                 {
                     animator.Play(levelUp ? "open" : "idle", 0);
+                    if (levelUp)
+                    {
+                        StartCoroutine(Co_DelayEffect(animator));
+                    }
                 }
+            }
+        }
+
+        IEnumerator Co_DelayEffect(Animator animator)
+        {
+            yield return WaitingForSecondConst.WaitMS300;
+            if (animator != null)
+            {
+                animator.Play("idle", 0, 0);
             }
         }
 
         public void Dispose()
         {
             model.selectRealmRefresh -= SelectRealmRefresh;
+            StopAllCoroutines();
         }
 
         private void SelectRealmRefresh()
diff --git a/System/Realm/RealmWin.cs b/System/Realm/RealmWin.cs
index 2b53d41..a2516d9 100644
--- a/System/Realm/RealmWin.cs
+++ b/System/Realm/RealmWin.cs
@@ -269,15 +269,19 @@
                 var currentStage = model.GetRealmStage(cacheRealmLevel);
                 if (cacheRealmLevel > realmLevel || stage > currentStage + 1)
                 {
+                    model.selectRealm = realmLevel + 1;
                     DisplayRealmStages();
                 }
                 else
                 {
-                    List<int> realms = null;
-                    if (model.TryGetRealmStages(currentStage, out realms))
+                    if (cacheRealmLevel < realmLevel)
                     {
-                        var index = realms.IndexOf(cacheRealmLevel);
-                        m_RealmAnimation.DisplayLevelUp(realms.IndexOf(cacheRealmLevel));
+                        List<int> realms = null;
+                        if (model.TryGetRealmStages(currentStage, out realms))
+                        {
+                            var index = realms.IndexOf(cacheRealmLevel);
+                            m_RealmAnimation.DisplayLevelUp(realms.IndexOf(cacheRealmLevel));
+                        }
                     }
                 }
                 cacheRealmLevel = realmLevel;

--
Gitblit v1.8.0