public static void InitToolTip(Editor editor) { TooltipContentState state; if (!currentStateCache.TryGetValue(editor, out state)) { state = new TooltipContentState(); currentStateCache[editor] = state; } InitToolTip(state, editor); }
public static void InitToolTip(SceneView sceneView) { TooltipContentState state; if (!currentStateCache.TryGetValue(sceneView, out state)) { state = new TooltipContentState(); currentStateCache[sceneView] = state; } InitToolTip(state, sceneView); }
static void InitToolTip(TooltipContentState state, EditorWindow editorWindow) { currentState = state; if (Event.current.type != EventType.Repaint) { return; } currentState.currentToolTip = null; currentState.drawnThisFrame = false; currentState.editorWindow = editorWindow; currentState.editor = null; currentState.maxArea = new Rect(0, 0, editorWindow.position.width, editorWindow.position.height); }
static void InitToolTip(TooltipContentState state, Editor editor) { currentState = state; if (Event.current.type != EventType.Repaint && Event.current.type != EventType.Layout) { return; } currentState.currentToolTip = null; currentState.drawnThisFrame = false; currentState.editorWindow = null; currentState.editor = editor; currentState.maxArea = new Rect(0, 0, EditorGUIUtility.currentViewWidth, Screen.height); }