rokojori_action_library/Runtime/Behavior/StateMachine/StateEnterExitAction.cs

39 lines
663 B
C#

using Godot;
using Rokojori.Extensions;
namespace Rokojori;
[Tool]
[GlobalClass, Icon("res://addons/rokojori_action_library/Icons/OnEvent.svg")]
public abstract partial class StateEnterExitAction:Sequence
{
[Export]
public SceneCondition sceneCondition;
[Export]
public Condition condition;
[Export]
public State state;
public bool Matches( State other )
{
if ( state != null && state != other )
{
return false;
}
if ( sceneCondition != null && ! sceneCondition.Evaluate() )
{
return false;
}
if ( condition != null && ! condition.Evaluate() )
{
return false;
}
return true;
}
}