From 24f59b89e9eabcfe948fc0ba304a8dbec2deda14 Mon Sep 17 00:00:00 2001 From: River Jiang <546213258@qq.com> Date: Tue, 27 Oct 2020 14:09:47 +0800 Subject: [PATCH] Merge branch 'master' of http://172.16.1.52:8090/r/GemBattle into master --- Assets/Scripts/TowerDefense/Agents/Agent.cs | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/Assets/Scripts/TowerDefense/Agents/Agent.cs b/Assets/Scripts/TowerDefense/Agents/Agent.cs index a9d1bf3..44df4e4 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 @@ -848,7 +854,7 @@ this.UpdateAction(); // 处理死亡状态了,不必再移动: - if (bInDeathAct) return; + if (bInDeathAct || !CanMove) return; m_Destination = initNode.GetNextNode(); updateAgentPos(Time.deltaTime); -- Gitblit v1.9.1