From 43b531f76be6e12c775a1135f6895e8fdc389a59 Mon Sep 17 00:00:00 2001
From: chenxin <chenxin6991@163.com>
Date: Tue, 27 Oct 2020 17:39:23 +0800
Subject: [PATCH] Merge branch 'master' of http://172.16.1.52:8090/r/GemBattle into master

---
 Assets/Scripts/TowerDefense/Agents/Agent.cs |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/Assets/Scripts/TowerDefense/Agents/Agent.cs b/Assets/Scripts/TowerDefense/Agents/Agent.cs
index a9d1bf3..d7e7342 100644
--- a/Assets/Scripts/TowerDefense/Agents/Agent.cs
+++ b/Assets/Scripts/TowerDefense/Agents/Agent.cs
@@ -193,6 +193,12 @@
         protected bool bInDeathAct = false;
 
         /// <summary>
+        /// 原地罚站
+        /// </summary>
+        /// <param name="can"></param>
+        public bool CanMove { get; set; } = true;
+
+        /// <summary>
         /// Gets the attached nav mesh agent velocity
         /// </summary>
         public override Vector3 velocity
@@ -314,6 +320,7 @@
             poisonTimes = 0;
             timeToPoisonHurt = 0;
             bShieldBreak = false;
+            CanMove = true;
 
             /*// 如果对应的粒子不为空,则播放
 			if( spawnParticle)
@@ -404,7 +411,11 @@
                 if (MoveStopEffect)
                     return;
 
-                MoveStopEffect = Instantiate(WaveLineSelMgr.instance.bufStopMovePrefab);
+                GameObject obj = Instantiate(WaveLineSelMgr.instance.bufStopMovePrefab);
+                MoveStopEffect = obj.GetComponent<ParticleSystem>();
+
+                if (MoveStopEffect == null)
+                    MoveStopEffect = obj.transform.GetChild(0).GetComponent<ParticleSystem>();
                 MoveStopEffect.transform.position = this.position;
                 MoveStopEffect.Play();
             }
@@ -417,7 +428,11 @@
                 if (MoveStopEffect)
                     return;
 
-                MoveStopEffect = Instantiate(EndlessWaveLineManager.instance.bufStopMovePrefab);
+                GameObject obj = Instantiate(EndlessWaveLineManager.instance.bufStopMovePrefab);
+                MoveStopEffect = obj.GetComponent<ParticleSystem>();
+
+                if (MoveStopEffect == null)
+                    MoveStopEffect = obj.transform.GetChild(0).GetComponent<ParticleSystem>();
                 MoveStopEffect.transform.position = this.position;
                 MoveStopEffect.Play();
             }
@@ -848,7 +863,7 @@
             this.UpdateAction();
 
             // 处理死亡状态了,不必再移动:
-            if (bInDeathAct) return;
+            if (bInDeathAct || !CanMove) return;
 
             m_Destination = initNode.GetNextNode();
             updateAgentPos(Time.deltaTime);

--
Gitblit v1.9.1