using System; using UnityEditor; using UnityEngine; namespace TriInspectorUnityInternalBridge { internal static class GUIClipProxy { private static Func _guiClipUnClipVector2; [InitializeOnLoadMethod] private static void Setup() { var imGuiModuleAssembly = typeof(GUI).Assembly; var guiClipType = imGuiModuleAssembly.GetType("UnityEngine.GUIClip", throwOnError: true); _guiClipUnClipVector2 = (Func) Delegate.CreateDelegate(typeof(Func), guiClipType.GetMethod("Unclip", new[] {typeof(Vector2)})); } public static Vector2 UnClip(Vector2 pos) { return _guiClipUnClipVector2.Invoke(pos); } } }