Files
unity-iso-tools/Assets/PlayMaker/Actions/AnyKey.cs
2015-12-13 14:35:35 +06:00

28 lines
596 B
C#
Executable File

// (c) Copyright HutongGames, LLC 2010-2013. All rights reserved.
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Input)]
[Tooltip("Sends an Event when the user hits any Key or Mouse Button.")]
public class AnyKey : FsmStateAction
{
[RequiredField]
[Tooltip("Event to send when any Key or Mouse Button is pressed.")]
public FsmEvent sendEvent;
public override void Reset()
{
sendEvent = null;
}
public override void OnUpdate()
{
if (Input.anyKeyDown)
{
Fsm.Event(sendEvent);
}
}
}
}