namespace Zinnia.Rule
{
using UnityEngine;
using Zinnia.Action;
///
/// Determines whether an action is activated or deactivated.
///
public class ActionRule : Rule
{
[Tooltip("The Action to check.")]
[SerializeField]
private Action action;
///
/// The to check.
///
public Action Action
{
get
{
return action;
}
set
{
action = value;
}
}
///
public override bool Accepts(object _ = null)
{
return Accepts(Action);
}
///
/// Determines whether the given is activated.
///
/// The action to check.
/// Whther the action is activated.
public virtual bool Accepts(Action action)
{
if (ShouldAutoRejectDueToState())
{
return false;
}
return action.IsActivated;
}
}
}