While Mouse Dragging#
Input / Cursor / While Mouse Dragging
Description#
Executed every frame the mouse button is held down after being pressed over the target collider
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Title("While Mouse Dragging")]
[Image(typeof(IconMouse), ColorTheme.Type.Blue, typeof(BadgeArrowRight))]
[Description("Executed every frame the mouse button is held down after being pressed over the target collider")]
[Category("Input/Cursor/While Mouse Dragging")]
[Keywords("Drag", "Hold", "Move", "Collider", "Cursor", "Pick", "Touch")]
[Serializable]
public class TriggerCoreMouseDrag : TriggerHandleSourceBase<HandleOnMouseDrag>
{
// PROPERTIES: ----------------------------------------------------------------------------
protected override string GetTitle(GameObject source) => $"Dragging {this.SourceName}";
// OVERRIDE METHODS: ----------------------------------------------------------------------
protected override void OnTrigger(GameObject target)
{
using Args args = Args.Get(this.Component, target);
this.Run(args);
}
}
}