Created
April 3, 2015 11:56
-
-
Save jeanfabre/04b4cc8b1096c7e1a7da to your computer and use it in GitHub Desktop.
__ECO__ __ACTION__ Category:Input __GIST__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// (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