#if HAVE_NODECANVAS using System; using ParadoxNotion.Design; using NodeCanvas.Framework; namespace Framework.Actors { /// Switches an actor presenter to a different state [Category("Actors")] [Description("Change the animation state of an actor presenter")] public class SetPresenterStateTask : ActionTask { /// Actor whose state will be switched /// > /// We intentionally ask for an actor controller instead of a presenter here /// because typically, you want to do more with the actor in the same diagram /// and having the same game object referenced multiple times under different /// interfaces would be a pain in the behind. /// [RequiredField] public BBParameter Actor; /// State to which the actor presenter will be switched public int State; /// Summary of what this action does protected override string info { get { return "Set " + this.Actor.name + " to state " + this.State.ToString(); } } /// Called once when the action is executed protected override void OnExecute() { this.Actor.value.Presenter.State = this.State; EndAction(); } } } // namespace Framework.Actors #endif // HAVE_NODECANVAS