using System.Collections.Generic; using Opsive.BehaviorDesigner.AddOns.Shared.Demo; using Opsive.BehaviorDesigner.Runtime.Tasks; using Opsive.GraphDesigner.Runtime; using Opsive.GraphDesigner.Runtime.Variables; using Opsive.Shared.Utility; using UnityEngine; namespace Cielonos.MainGame.Characters.AI { [Description("设置角色下一次动作的可打断状态。(白光,橙光,红光)")] [NodeIcon("Assets/Sprites/Icon/Play.png")] [Category("Cielonos")] public class SetBreakthroughResistance : AutomataActionBase { [Tooltip("默认的最低可打断类型。抵抗低于该类型的突破,被高于该类型的突破打断。")] public SharedVariable defaultLowestBreakthroughableType; [Tooltip("是否启用高级设置")] public bool advancedSettings; [Tooltip("抵抗的突破类型列表。")] public List resistanceTypes; [Tooltip("可打断的突破类型列表。")] public List breakthroughableTypes; public override TaskStatus OnUpdate() { if (self == null || mainBehaviorTree == null || mainBehaviorTree.GetVariable("BreakthroughableType") == null) { Debug.LogWarning("SetBreakthroughResistance: Missing components or variables."); return TaskStatus.Failure; } mainBehaviorTree.SetVariableValue("BreakthroughableType", defaultLowestBreakthroughableType.Value.ToString()); return TaskStatus.Success; } } }