Files
beyond/Assets/ThirdParty/PlayMaker/Actions/StateMachine/GetLastEvent.cs
2024-11-20 15:21:28 +01:00

26 lines
612 B
C#

// (c) Copyright HutongGames, LLC 2010-2013. All rights reserved.
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.StateMachine)]
[Tooltip("Gets the event that caused the transition to the current state, and stores it in a String Variable.")]
public class GetLastEvent : FsmStateAction
{
[UIHint(UIHint.Variable)]
public FsmString storeEvent;
public override void Reset()
{
storeEvent = null;
}
public override void OnEnter()
{
storeEvent.Value = Fsm.LastTransition == null ? "START" : Fsm.LastTransition.EventName;
Finish();
}
}
}