A game about forced loneliness, made by TACStudios
at master 1.4 kB view raw
1using System; 2using UnityEngine; 3 4using UnityEngine.UIElements; 5 6namespace UnityEditor.ShaderGraph.Drawing 7{ 8 static class CompatibilityExtensions 9 { 10#if !UNITY_2018_3_OR_NEWER 11 public static void MarkDirtyRepaint(this VisualElement element) 12 { 13 element.Dirty(ChangeType.Repaint); 14 } 15 16#endif 17 18#if !UNITY_2018_3_OR_NEWER 19 public static void CaptureMouse(this VisualElement element) 20 { 21 element.TakeMouseCapture(); 22 } 23 24 public static void ReleaseMouse(this VisualElement element) 25 { 26 element.ReleaseMouseCapture(); 27 } 28 29#endif 30 31 public static void OnToggleChanged(this Toggle toggle, EventCallback<ChangeEvent<bool>> callback) 32 { 33#if UNITY_2018_3_OR_NEWER 34 toggle.RegisterValueChangedCallback(callback); 35#else 36 toggle.OnToggle(() => callback(ChangeEvent<bool>.GetPooled(!toggle.value, toggle.value))); 37#endif 38 } 39 } 40 41 static class TrickleDownEnum 42 { 43#if UNITY_2018_3_OR_NEWER 44 public static readonly TrickleDown NoTrickleDown = TrickleDown.NoTrickleDown; 45 public static readonly TrickleDown TrickleDown = TrickleDown.TrickleDown; 46#else 47 public static readonly Capture NoTrickleDown = Capture.NoCapture; 48 public static readonly Capture TrickleDown = Capture.Capture; 49#endif 50 } 51}