From 6f16dfb8bcebe67aeb95ded0d8b644af4932e690 Mon Sep 17 00:00:00 2001 From: chenxin <chenxin6991@163.com> Date: Mon, 26 Oct 2020 21:00:32 +0800 Subject: [PATCH] 无尽模式新手步骤到水元素放置塔位完成 --- 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