/* * @Author: 白哉 * @Description: * @Date: 2025年06月06日 星期五 19:06:16 * @Modify: */ using System.Collections.Generic; using Logic.Action; using Logic.AI; using NodeCanvas.Framework; using ParadoxNotion.Design; namespace NodeCanvas.Tasks.Actions { [Category("AIAction")] public class AIGeneratorAction : ActionTask { public List ActionTypes; protected override string info { get { return string.Format($"构建 {ActionTypes[0]} 行为"); } } protected override void OnExecute() { // 直接从Blackboard获取AICalculatorData var data = blackboard.GetVariable("Data"); if (data?.value == null) { EndAction(false); return; } data.value.AIActions.Clear(); data.value.MaxAiAction = null; foreach (var actionType in ActionTypes)AIActionGenerator.GeneratorActionIds(data.value, actionType); if (data.value.AIActions.Count == 0) { EndAction(false); return; } EndAction(true); } } }