From bb38c584b5dee3a6b181b8a9fbc7eaeb16337afe Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期四, 31 一月 2019 19:28:46 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs   |   38 +-----------
 System/JadeDynastyKnapSack/JadeDynastyEquipModel.cs |  124 +++++++++++++++++++++++++++--------------
 2 files changed, 87 insertions(+), 75 deletions(-)

diff --git a/System/JadeDynastyKnapSack/JadeDynastyEquipModel.cs b/System/JadeDynastyKnapSack/JadeDynastyEquipModel.cs
index 2a4227a..3d83dca 100644
--- a/System/JadeDynastyKnapSack/JadeDynastyEquipModel.cs
+++ b/System/JadeDynastyKnapSack/JadeDynastyEquipModel.cs
@@ -18,7 +18,7 @@
         public string LocalSaveEquipUnlock { get; private set; }
         public string LocalSaveActiveSuit { get; private set; }
         public string LocalSaveActiveStoneSuit { get; private set; }
-
+    
         public int UnlockTowerLayer
         {
             get { return towerModel.highestPassFloor; }
@@ -377,6 +377,87 @@
             if (unlockEquips == null) return false;
 
             return unlockEquips.Contains(equipPlace);
+        }
+
+        public bool IsPlaySuitPlayerEffect()
+        {
+            List<int> suitTypes = null;
+            List<int> suitLvs = null;
+            bool isActiveSuit = TryGetIsActiveSuit(out suitTypes, out suitLvs);
+            if (isActiveSuit)
+            {
+                for (int i = 0; i < suitTypes.Count; i++)
+                {
+                    int suitType = suitTypes[i];
+                    int suitLv = suitLvs[i];
+                    bool isLocalSaveActiveSuit = IsLocalSaveActiveSuit(suitType, suitLv);
+                    if(!isLocalSaveActiveSuit)
+                    {
+                        return true;
+                    }
+                }
+            }
+
+            return false;
+        }
+
+        public void StopPlaySuitEffect(UIEffect effect,bool isSave = false)
+        {
+            if (isSave)
+            {
+                if (effect.IsPlaying)
+                {
+                    List<int> suitTypes = null;
+                    List<int> suitLvs = null;
+                    bool isActiveSuit = TryGetIsActiveSuit(out suitTypes, out suitLvs);
+                    SetLockLocalSaveActiveSuit(suitTypes, suitLvs);
+                }
+            }
+
+            if (effect.IsPlaying)
+            {
+                effect.Stop();
+            }
+        }
+
+        public bool IsPlayStoneSuitEffect()
+        {
+            List<int> suitTypes = null;
+            List<int> suitLvs = null;
+            bool isActiveSuit = TryGetIsActiveStoneSuit(out suitTypes, out suitLvs);
+            if (isActiveSuit)
+            {
+                for (int i = 0; i < suitTypes.Count; i++)
+                {
+                    int suitType = suitTypes[i];
+                    int suitLv = suitLvs[i];
+                    bool isLocalSaveActiveSuit = IsLocalSaveActiveStoneSuit(suitType, suitLv);
+                    if (!isLocalSaveActiveSuit)
+                    {
+                        return true;
+                    }
+                }
+            }
+            return false;
+        }
+
+        public void StopPlayStoneSuitEffect(UIEffect effect, bool isSave = false)
+        {
+            if (isSave)
+            {
+                if (effect.IsPlaying)
+                {
+                    List<int> suitTypes = null;
+                    List<int> suitLvs = null;
+                    bool isActiveSuit = TryGetIsActiveStoneSuit(out suitTypes, out suitLvs);
+                    SetLockLocalSaveActiveStoneSuit(suitTypes, suitLvs);
+                }
+            }
+
+            if (effect.IsPlaying)
+            {
+                effect.Stop();
+            }
         }
         #endregion
 
@@ -840,46 +921,5 @@
 
             return activeSuit != null || nextSuit != null;
         }
-
-        public bool IsPlayStoneSuitEffect()
-        {
-            List<int> suitTypes = null;
-            List<int> suitLvs = null;
-            bool isActiveSuit = TryGetIsActiveStoneSuit(out suitTypes, out suitLvs);
-            if (isActiveSuit)
-            {
-                for (int i = 0; i < suitTypes.Count; i++)
-                {
-                    int suitType = suitTypes[i];
-                    int suitLv = suitLvs[i];
-                    bool isLocalSaveActiveSuit = IsLocalSaveActiveStoneSuit(suitType, suitLv);
-                    if (!isLocalSaveActiveSuit)
-                    {
-                        return true;
-                    }
-                }
-            }
-            return false;
-        }
-
-        public void StopPlayStoneSuitEffect(UIEffect effect,bool isSave = false)
-        {
-            if (isSave)
-            {
-                if (effect.IsPlaying)
-                {
-                    List<int> suitTypes = null;
-                    List<int> suitLvs = null;
-                    bool isActiveSuit = TryGetIsActiveStoneSuit(out suitTypes, out suitLvs);
-                    SetLockLocalSaveActiveStoneSuit(suitTypes, suitLvs);
-                }
-            }
-
-            if (effect.IsPlaying)
-            {
-                effect.Stop();
-            }
-        }
-
     }
 }
diff --git a/System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs b/System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs
index 845c924..818edc5 100644
--- a/System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs
+++ b/System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs
@@ -172,45 +172,17 @@
 
         private void UpdateSuitBtnPlayerEffect(bool isSave = false)
         {
-            List<int> suitTypes = null;
-            List<int> suitLvs = null;
-            bool isActiveSuit = equipModel.TryGetIsActiveSuit(out suitTypes,out suitLvs);
-            if(isActiveSuit)
+            bool isPlay = equipModel.IsPlaySuitPlayerEffect();
+            if(isPlay && !isSave)
             {
-                for (int i = 0; i < suitTypes.Count; i++)
+                if (!suitBtnEffect.IsPlaying)
                 {
-                    int suitType = suitTypes[i];
-                    int suitLv = suitLvs[i];
-                    bool isLocalSaveActiveSuit = equipModel.IsLocalSaveActiveSuit(suitType, suitLv);
-                    if (!isLocalSaveActiveSuit)
-                    {
-                        if (!suitBtnEffect.IsPlaying)
-                        {
-                            suitBtnEffect.Play();
-                        }
-                        break;
-                    }
-                    else
-                    {
-                        if (suitBtnEffect.IsPlaying)
-                        {
-                            suitBtnEffect.Stop();
-                        }
-                    }
+                    suitBtnEffect.Play();
                 }
             }
             else
             {
-                if (suitBtnEffect.IsPlaying)
-                {
-                    suitBtnEffect.Stop();
-                }
-            }
-
-            if(isSave && suitBtnEffect.IsPlaying)
-            {
-                suitBtnEffect.Stop();
-                equipModel.SetLockLocalSaveActiveSuit(suitTypes, suitLvs);
+                equipModel.StopPlaySuitEffect(suitBtnEffect,isSave);
             }
         }
 

--
Gitblit v1.8.0