using UnityEngine; using System; using UnityEngine.UIElements; namespace UnityEditor.ShaderGraph.Drawing { 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(); } } }