using UnityEngine; using UnityEngine.Experimental.UIElements; using System; namespace UnityEditor.ShaderGraph.Drawing { public class Scrollable : MouseManipulator { Action m_Handler; public Scrollable(Action handler) { m_Handler = handler; } protected override void RegisterCallbacksOnTarget() { target.RegisterCallback(HandleMouseWheelEvent); } protected override void UnregisterCallbacksFromTarget() { target.UnregisterCallback(HandleMouseWheelEvent); } void HandleMouseWheelEvent(WheelEvent evt) { m_Handler(evt.delta.y); evt.StopPropagation(); } } }