ProjectDDD/Assets/External/Behavior Designer/Runtime/Tasks/Unity/Input/GetMouseButton.cs
2025-07-07 19:25:56 +09:00

27 lines
730 B (Stored with Git LFS)
C#

using UnityEngine;
namespace BehaviorDesigner.Runtime.Tasks.Unity.UnityInput
{
[TaskCategory("Unity/Input")]
[TaskDescription("Stores the state of the specified mouse button.")]
public class GetMouseButton : Action
{
[Tooltip("The index of the button")]
public SharedInt buttonIndex;
[RequiredField]
[Tooltip("The stored result")]
public SharedBool storeResult;
public override TaskStatus OnUpdate()
{
storeResult.Value = Input.GetMouseButton(buttonIndex.Value);
return TaskStatus.Success;
}
public override void OnReset()
{
buttonIndex = 0;
storeResult = false;
}
}
}