blob: aafcb287b38aa51c1f420d32e7248e61b1378291 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
using UnityEngine;
namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput
{
[TaskCategory("Basic/Input")]
[TaskDescription("Stores the state of the specified button.")]
public class GetButton : Action
{
[Tooltip("The name of the button")]
public SharedString buttonName;
[RequiredField]
[Tooltip("The stored result")]
public SharedBool storeResult;
public override TaskStatus OnUpdate()
{
storeResult.Value = Input.GetButton(buttonName.Value);
return TaskStatus.Success;
}
public override void OnReset()
{
buttonName = "Fire1";
storeResult = false;
}
}
}
|