blob: 4912f7681eaadd2e9b4d11dc817e6cc776c185b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  | 
using UnityEngine;
namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput
{
    [TaskCategory("Basic/Input")]
    [TaskDescription("Returns success when the specified button is released.")]
    public class IsButtonUp : Conditional
    {
        [Tooltip("The name of the button")]
        public SharedString buttonName;
        public override TaskStatus OnUpdate()
        {
            return Input.GetButtonUp(buttonName.Value) ? TaskStatus.Success : TaskStatus.Failure;
        }
        public override void OnReset()
        {
            buttonName = "Fire1";
        }
    }
}
  |