Files
Cielonos/Assets/Scripts/MainGame/Characters/Automata/AI/Behaviors/SetBreakthroughResistance.cs

27 lines
980 B
C#
Raw Normal View History

2025-12-08 05:27:53 -05:00
using Opsive.BehaviorDesigner.Runtime.Tasks;
using Opsive.GraphDesigner.Runtime;
using Opsive.Shared.Utility;
using UnityEngine;
namespace Cielonos.MainGame.Characters.AI
{
[Description("设置角色下一次动作的可打断状态。(白光,橙光,红光)")]
[NodeIcon("Assets/Sprites/Icon/Play.png")]
[Category("Cielonos")]
public class SetBreakthroughResistance : AutomataActionBase
{
public BreakthroughType breakthroughableType;
public override TaskStatus OnUpdate()
{
if (self == null || behaviorTree == null || behaviorTree.GetVariable("BreakthroughableType") == null)
{
Debug.LogWarning("SetBreakthroughResistance: Missing components or variables.");
return TaskStatus.Failure;
}
behaviorTree.SetVariableValue("BreakthroughableType", breakthroughableType.ToString());
return TaskStatus.Success;
}
}
}