Tanoda
EditorPickingMeshRebuilder.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9using UnityEngine;
10using UnityEditor;
11
13
14 public static class EditorPickingMeshRebuilder {
15
16 [InitializeOnLoadMethod]
17 private static void initManager() {
18 #if UNITY_2019_1_OR_NEWER
19 SceneView.duringSceneGui += onSceneGui;
20 #else
21 SceneView.onSceneGUIDelegate += onSceneGui;
22 #endif
23 }
24
25 private static void onSceneGui(SceneView view) {
26 if (Event.current.type != EventType.MouseDown) {
27 return;
28 }
29
30 foreach (var graphicRenderer in Object.FindObjectsOfType<LeapGraphicRenderer>()) {
31 graphicRenderer.editor.RebuildEditorPickingMeshes();
32 }
33 }
34 }
35}
UnityEngine.Object Object