27 lines
980 B
C#
27 lines
980 B
C#
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;
|
|
}
|
|
}
|
|
} |