Skip to content

Instantly share code, notes, and snippets.

@jeanfabre
Created April 3, 2015 11:56
Show Gist options
  • Save jeanfabre/04b4cc8b1096c7e1a7da to your computer and use it in GitHub Desktop.
Save jeanfabre/04b4cc8b1096c7e1a7da to your computer and use it in GitHub Desktop.
__ECO__ __ACTION__ Category:Input __GIST__
// (c) Copyright HutongGames, LLC 2010-2015. All rights reserved.
/*--- __ECO__ __ACTION__ ---*/
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);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment