summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonDown.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonDown.cs')
-rw-r--r--Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonDown.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonDown.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonDown.cs
new file mode 100644
index 00000000..8a783800
--- /dev/null
+++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonDown.cs
@@ -0,0 +1,22 @@
+using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput
+{
+ [TaskCategory("Basic/Input")]
+ [TaskDescription("Returns success when the specified button is pressed.")]
+ public class IsButtonDown : Conditional
+ {
+ [Tooltip("The name of the button")]
+ public SharedString buttonName;
+
+ public override TaskStatus OnUpdate()
+ {
+ return Input.GetButtonDown(buttonName.Value) ? TaskStatus.Success : TaskStatus.Failure;
+ }
+
+ public override void OnReset()
+ {
+ buttonName = "Fire1";
+ }
+ }
+} \ No newline at end of file