(client) feat:窗口新增独占、占用输入属性,添加部分行为树节点和工作类

This commit is contained in:
m0_75251201
2025-07-31 17:45:50 +08:00
parent 82dc89c890
commit e1ff66ff28
41 changed files with 2418 additions and 7175 deletions

View File

@ -48,33 +48,17 @@ namespace AI
return null;
}
}
public class SequentialAI : Selector
public class SequenceAI : AIBase
{
private int currentIndex = 0; // 当前正在尝试的子节点索引
public override JobBase GetJob(Entity.Entity target)
{
// 如果当前索引超出了子节点范围,重置索引并返回 null
if (currentIndex >= children.Count)
foreach (var aiBase in children)
{
ResetIndex();
return null;
var job = aiBase.GetJob(target);
if (job == null)
return null; // 如果某个子节点返回 null则整个序列失败
}
// 获取当前子节点的任务
var currentChild = children[currentIndex];
var job = currentChild.GetJob(target);
// 移动到下一个子节点
currentIndex++;
return job;
}
// 重置当前索引(用于重新开始遍历)
private void ResetIndex()
{
currentIndex = 0;
return null; // 所有子节点完成时返回 null
}
}
public class ContinuousMove : AIBase
@ -99,5 +83,5 @@ namespace AI
return new WanderJob();
}
}
}