From 54b8092a18df967587195cefff1f929e8348f4e7 Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期三, 31 十月 2018 12:01:36 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 Fight/GameActor/GActorNpcNoFight.cs |    5 +
 Fight/GameActor/GActorNpcFight.cs   |   11 +++
 Fight/GameActor/GA_NpcCollect.cs    |    6 +
 Core/GameEngine/Login/Launch.cs     |    4 
 System/Dungeon/DungeonInspireWin.cs |   40 ++++++++-----
 Fight/Stage/StageManager.cs         |   48 ++++++++--------
 Fight/Stage/Dungeon/DungeonStage.cs |   27 ++++----
 Fight/GameActor/GActorPlayerBase.cs |    6 +
 8 files changed, 87 insertions(+), 60 deletions(-)

diff --git a/Core/GameEngine/Login/Launch.cs b/Core/GameEngine/Login/Launch.cs
index 4a42e9b..0a0fc25 100644
--- a/Core/GameEngine/Login/Launch.cs
+++ b/Core/GameEngine/Login/Launch.cs
@@ -117,10 +117,10 @@
 
                     File.Copy(fromPath, toPath, true);
                 }
+
+                LocalSave.SetString("BuiltInAssetCopyCompleted_IOS", VersionConfig.Get().version);
             }
         }
-
-        LocalSave.SetString("BuiltInAssetCopyCompleted_IOS", VersionConfig.Get().version);
 #endif
 
         if (!AssetSource.builtInFromEditor)
diff --git a/Fight/GameActor/GA_NpcCollect.cs b/Fight/GameActor/GA_NpcCollect.cs
index f948b50..2228f33 100644
--- a/Fight/GameActor/GA_NpcCollect.cs
+++ b/Fight/GameActor/GA_NpcCollect.cs
@@ -118,7 +118,11 @@
                     {
                         _controller = AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerSuffix, NpcConfig.MODE);
                     }
-                    m_Animator.runtimeAnimatorController = _controller;
+
+                    if (_controller)
+                    {
+                        m_Animator.runtimeAnimatorController = _controller;
+                    }
 
                     m_Animator.enabled = true;
                     m_Animator.SetInteger(GAStaticDefine.Param_ActorInstID, (int)clientInstID);
diff --git a/Fight/GameActor/GActorNpcFight.cs b/Fight/GameActor/GActorNpcFight.cs
index 934b35f..814cb94 100644
--- a/Fight/GameActor/GActorNpcFight.cs
+++ b/Fight/GameActor/GActorNpcFight.cs
@@ -144,7 +144,11 @@
                         _controller = AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerSuffix, NpcConfig.MODE);
 
                     }
-                    m_Animator.runtimeAnimatorController = _controller;
+
+                    if (_controller)
+                    {
+                        m_Animator.runtimeAnimatorController = _controller;
+                    }
 
                     m_Animator.enabled = true;
 
@@ -783,7 +787,10 @@
                 {
                     _controller = AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerSuffix, _npcConfig.MODE);
                 }
-
+                if (_controller)
+                {
+                    _a.runtimeAnimatorController = _controller;
+                }
                 _a.enabled = true;
                 _a.SetInteger(GAStaticDefine.Param_ActorInstID, (int)ClientInstID);
                 m_Animator.enabled = false;
diff --git a/Fight/GameActor/GActorNpcNoFight.cs b/Fight/GameActor/GActorNpcNoFight.cs
index 90bccd7..8392f71 100644
--- a/Fight/GameActor/GActorNpcNoFight.cs
+++ b/Fight/GameActor/GActorNpcNoFight.cs
@@ -200,7 +200,10 @@
                     {
                         _controller = AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerSuffix, NpcConfig.MODE);
                     }
-                    m_Animator.runtimeAnimatorController = _controller;
+                    if (_controller)
+                    {
+                        m_Animator.runtimeAnimatorController = _controller;
+                    }
                     m_Animator.enabled = true;
                     m_Animator.SetInteger(GAStaticDefine.Param_ActorInstID, (int)clientInstID);
                 }
diff --git a/Fight/GameActor/GActorPlayerBase.cs b/Fight/GameActor/GActorPlayerBase.cs
index 5f8538a..d92e7a0 100644
--- a/Fight/GameActor/GActorPlayerBase.cs
+++ b/Fight/GameActor/GActorPlayerBase.cs
@@ -1267,8 +1267,10 @@
             {
                 _controller = AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerSuffix, _modelResConfig.ResourcesName);
             }
-
-            m_HorseAnimator.runtimeAnimatorController = _controller;
+            if (_controller)
+            {
+                m_HorseAnimator.runtimeAnimatorController = _controller;
+            }
             m_HorseAnimator.enabled = true;
 
             // 鍏堣缃牴鑺傜偣
diff --git a/Fight/Stage/Dungeon/DungeonStage.cs b/Fight/Stage/Dungeon/DungeonStage.cs
index 5bc0679..5766516 100644
--- a/Fight/Stage/Dungeon/DungeonStage.cs
+++ b/Fight/Stage/Dungeon/DungeonStage.cs
@@ -11,7 +11,8 @@
     public static MapType CurrentMapType;
 
     HeavenBattleModel _heavenModel;
-    HeavenBattleModel heavenModel {
+    HeavenBattleModel heavenModel
+    {
         get { return _heavenModel ?? (_heavenModel = ModelCenter.Instance.GetModel<HeavenBattleModel>()); }
     }
 
@@ -33,10 +34,10 @@
         SoundPlayer.Instance.PlayBackGroundMusic(mapResConfig.Music);
 
         // 鍋氫竴浜涘墠鏈熸垬鏂楃殑棰勫姞杞�
-        if (!PreFightMission.Instance.IsFinished())
-        {
-            PreFightMission.Instance.PreLoad();
-        }
+        // if (!PreFightMission.Instance.IsFinished())
+        // {
+        //     PreFightMission.Instance.PreLoad();
+        // }
     }
 
     protected override void OnStageLoadFinish()
@@ -62,10 +63,10 @@
         GA_Hero.s_MapSwitching = false;
         GA_Hero.forceAutoFight = false;
 
-        if (PreFightMission.Instance.IsFinished() == false)
-        {
-            PreFightMission.Instance.Start();
-        }
+        // if (PreFightMission.Instance.IsFinished() == false)
+        // {
+        //     PreFightMission.Instance.Start();
+        // }
 
         WindowCenter.Instance.Open<MapNameHintWin>();
         WindowCenter.Instance.Open<ExperienceGetWin>();
@@ -140,10 +141,10 @@
 
         DropItemManager.Update();
 
-        if (PreFightMission.Instance.IsFinished() == false)
-        {
-            PreFightMission.Instance.Update();
-        }
+        // if (PreFightMission.Instance.IsFinished() == false)
+        // {
+        //     PreFightMission.Instance.Update();
+        // }
     }
 
     protected override void OnFixedUpdate()
diff --git a/Fight/Stage/StageManager.cs b/Fight/Stage/StageManager.cs
index 3d3b8dc..0faa26d 100644
--- a/Fight/Stage/StageManager.cs
+++ b/Fight/Stage/StageManager.cs
@@ -269,32 +269,32 @@
             yield return null;
         }
 
-        if (_stageId == 10010)
-        {
-            while (!PreFightMission.Instance.IsHandleMissionState)
-            {
-                yield return null;
-            }
+        // if (_stageId == 10010)
+        // {
+        //     while (!PreFightMission.Instance.IsHandleMissionState)
+        //     {
+        //         yield return null;
+        //     }
 
-            try
-            {
-                // 濡傛灉鐢ㄦ埛灏氭湭瀹屾垚鍓嶆湡鎴樻枟閮ㄥ垎
-                if (!PreFightMission.Instance.IsFinished())
-                {
-                    if (!AssetSource.sceneFromEditor)
-                    {
-                        AssetBundleUtility.Instance.Sync_LoadAll("maps/map000_xsdt");
-                    }
-                    SceneManager.LoadScene("Map000_Xsdt", LoadSceneMode.Additive);
-                }
-            }
-            catch (System.Exception ex)
-            {
-                ExceptionCatcher.ReportException("鍦烘櫙鍔犺浇 Step5", ex);
-            }
-        }
+        //     try
+        //     {
+        //         // 濡傛灉鐢ㄦ埛灏氭湭瀹屾垚鍓嶆湡鎴樻枟閮ㄥ垎
+        //         if (!PreFightMission.Instance.IsFinished())
+        //         {
+        //             if (!AssetSource.sceneFromEditor)
+        //             {
+        //                 AssetBundleUtility.Instance.Sync_LoadAll("maps/map000_xsdt");
+        //             }
+        //             SceneManager.LoadScene("Map000_Xsdt", LoadSceneMode.Additive);
+        //         }
+        //     }
+        //     catch (System.Exception ex)
+        //     {
+        //         ExceptionCatcher.ReportException("鍦烘櫙鍔犺浇 Step5", ex);
+        //     }
+        // }
 
-        yield return null;
+        // yield return null;
         loadingProgress = loadingProgress + 0.1f;
 
         // 鍦烘櫙鍔犺浇瀹屽氨鍙互纭畾鐜╁浣嶇疆浜�, 涓嶉渶瑕佺瓑寰呭叿浣撳満鏅殑閫昏緫鍒濆鍖�
diff --git a/System/Dungeon/DungeonInspireWin.cs b/System/Dungeon/DungeonInspireWin.cs
index 2dc4de6..f35d43e 100644
--- a/System/Dungeon/DungeonInspireWin.cs
+++ b/System/Dungeon/DungeonInspireWin.cs
@@ -79,7 +79,7 @@
 
             m_CoinInspire.gameObject.SetActive(coinInspireConfig != null);
 
-            coinInspire = coinInspireConfig == null ? false : true;
+            coinInspire = IsCoinInspireLimit() ? false : true;
             fairyInspire = !coinInspire;
 
             Display();
@@ -120,36 +120,37 @@
                 CloseImmediately();
                 return;
             }
+
+            if (IsCoinInspireLimit() && coinInspire)
+            {
+                coinInspire = false;
+                fairyInspire = !coinInspire;
+            }
+
             DisplayCost();
             UpdateInspireType();
         }
 
         private void CoinInspire()
         {
-            if (!coinInspire)
+            if (!coinInspire && IsCoinInspireLimit())
             {
-                if (model.GetDungeonInspireLevel(3) >= coinInspireConfig.InspireCount)
-                {
-                    SysNotifyMgr.Instance.ShowTip("Xjmj_CopperInspireFull");
-                    return;
-                }
-                coinInspire = true;
-                fairyInspire = false;
+                SysNotifyMgr.Instance.ShowTip("Xjmj_CopperInspireFull");
+                return;
             }
-            else
-            {
-                coinInspire = false;
-            }
+            coinInspire = true;
+            fairyInspire = !coinInspire;
             UpdateInspireType();
         }
+
         private void FairyInspire()
         {
             if (coinInspireConfig == null)
             {
                 return;
             }
+            fairyInspire = true;
             coinInspire = false;
-            fairyInspire = !fairyInspire;
             UpdateInspireType();
         }
 
@@ -260,11 +261,20 @@
             return false;
         }
 
+        bool IsCoinInspireLimit()
+        {
+            if (coinInspireConfig != null)
+            {
+                return model.GetDungeonInspireLevel(3) >= coinInspireConfig.InspireCount;
+            }
+            return true;
+        }
+
         private void UpdateInspireType()
         {
             var level = model.GetDungeonInspireLevel();
             m_InspireLevel.text = level == 0 ? Language.Get("FairyLand_Func4")
-                : Language.Get("HaveInspired", StringUtility.Contact("<color=#109d06>", 
+                : Language.Get("HaveInspired", StringUtility.Contact("<color=#109d06>",
                 level * model.GetDungeonInspireUpper(PlayerDatas.Instance.baseData.MapID), "%</color>"));
             m_CoinInspireCheck.gameObject.SetActive(coinInspire);
             m_FairyInspireCheck.gameObject.SetActive(fairyInspire);

--
Gitblit v1.8.0