(client) feat:实现行为树条件节点的实际功能
This commit is contained in:
@ -84,11 +84,15 @@ namespace Entity
|
||||
{
|
||||
IsChase = true;
|
||||
currentJob = null;
|
||||
if(Program.Instance.focusedEntity)
|
||||
// 逻辑修改:只有当存在一个不同的焦点实体时,才将其PlayerControlled设为false
|
||||
if (Program.Instance.focusedEntity && Program.Instance.focusedEntity != this)
|
||||
{
|
||||
Program.Instance.focusedEntity.PlayerControlled = false;
|
||||
}
|
||||
Program.Instance.focusedEntity = this;
|
||||
}
|
||||
else if (PlayerControlled)
|
||||
// 逻辑修改:确保只有当自身是焦点实体时才取消焦点,避免不必要的逻辑执行
|
||||
else if (Program.Instance.focusedEntity == this)
|
||||
{
|
||||
Program.Instance.focusedEntity = null;
|
||||
}
|
||||
@ -96,6 +100,7 @@ namespace Entity
|
||||
get => Program.Instance.focusedEntity == this;
|
||||
}
|
||||
|
||||
|
||||
public bool IsWalking => _walkingTimer > 0;
|
||||
|
||||
/// <summary>
|
||||
|
Reference in New Issue
Block a user