IndieGame/client/Assets/ParadoxNotion/NodeCanvas/Tasks/Actions/Input/GetMouseScrollDelta.cs

28 lines
675 B
C#
Raw Normal View History

2024-10-11 10:12:15 +08:00
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
namespace NodeCanvas.Tasks.Actions
{
[Category("Input (Legacy System)")]
public class GetMouseScrollDelta : ActionTask
{
[BlackboardOnly] public BBParameter<float> saveAs;
public bool repeat = false;
protected override string info {
get { return "Get Scroll Delta as " + saveAs; }
}
protected override void OnExecute() { Do(); }
protected override void OnUpdate() { Do(); }
void Do() {
saveAs.value = Input.GetAxis("Mouse ScrollWheel");
if ( !repeat ) { EndAction(); }
}
}
}