From 416fbb174c1a8a6ed97e8fdee6c374a64f6fe027 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期六, 29 九月 2018 21:18:56 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/KnapSack/Logic/BoxGetItemWin.cs |   53 ++++++++++++++++++++++++++++++++---------------------
 1 files changed, 32 insertions(+), 21 deletions(-)

diff --git a/System/KnapSack/Logic/BoxGetItemWin.cs b/System/KnapSack/Logic/BoxGetItemWin.cs
index e2b10ed..96c6040 100644
--- a/System/KnapSack/Logic/BoxGetItemWin.cs
+++ b/System/KnapSack/Logic/BoxGetItemWin.cs
@@ -66,6 +66,11 @@
             ShowUICtrl();
         }
 
+        protected override void OnActived()
+        {
+            UpdateFireEffect();
+        }
+
         protected override void OnAfterOpen()
         {
             this.transform.SetAsLastSibling();
@@ -91,6 +96,33 @@
         private void RefreshGetIem(int useId, int useCnt, BoxGetItemInfo[] info)
         {
             ShowUICtrl();
+        }
+
+        private void UpdateFireEffect()
+        {
+            if (BoxModel.getItems == null) return;
+
+            bool isFireBox = false;
+            foreach (var key in ceremonyModel.fireDict.Keys)
+            {
+                StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(ceremonyModel.fireDict[key]);
+                if (storeConfig != null)
+                {
+                    if (storeConfig.ItemID == BoxModel.itemId)
+                    {
+                        isFireBox = true;
+                        if (!fireEffect.IsPlaying)
+                        {
+                            fireEffect.Play();
+                            return;
+                        }
+                    }
+                }
+            }
+            if(!isFireBox)
+            {
+                fireEffect.Stop();
+            }
         }
 
         private void ShowUICtrl()
@@ -125,27 +157,6 @@
             else
             {
                 getCoinsText.gameObject.SetActive(false);
-            }
-
-            foreach(var key in ceremonyModel.fireDict.Keys)
-            {
-                StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(ceremonyModel.fireDict[key]);
-                if(storeConfig != null)
-                {
-                    if(storeConfig.ItemID == BoxModel.itemId)
-                    {
-                        if (!fireEffect.IsPlaying)
-                        {
-                            fireEffect.Play();
-                            return;
-                        }
-                    }
-                }
-            }
-
-            if (fireEffect.IsPlaying)
-            {
-                fireEffect.Stop();
             }
         }
 

--
Gitblit v1.8.0