refactor(ai): 终审收尾——删死字段/事件转换刷新IsSuspended + 局部事件与双实例独立性测试

This commit is contained in:
2026-07-03 14:33:23 +08:00
parent 747d39072e
commit 11e4c9f1ea
3 changed files with 43 additions and 4 deletions
+2 -3
View File
@@ -23,7 +23,7 @@ namespace BaseGames.AI
s = new AiState(name);
_states[name] = s;
}
return new StateBuilder(this, s);
return new StateBuilder(s);
}
public GlobalBuilder Global() => new GlobalBuilder(this);
@@ -52,9 +52,8 @@ namespace BaseGames.AI
public sealed class StateBuilder
{
readonly BrainBuilder _owner;
readonly AiState _state;
internal StateBuilder(BrainBuilder owner, AiState state) { _owner = owner; _state = state; }
internal StateBuilder(AiState state) { _state = state; }
public StateBuilder OnEnter(Action<IAiContext> fn) { _state.OnEnter = fn; return this; }
public StateBuilder Tick(Action<IAiContext> fn) { _state.OnTick = (c, _) => fn(c); return this; }