void OnEnable() { s_Instance = this; mesh = new Mesh(); material = new Material(Shader.Find("ProBuilder/UnlitVertexColor")); mesh.hideFlags = HideFlags.DontSave; material.hideFlags = HideFlags.DontSave; #if UNITY_2019_1_OR_NEWER SceneView.duringSceneGui += OnSceneGUI; #else SceneView.onSceneGUIDelegate += OnSceneGUI; #endif }
void OnEnable() { s_Instance = this; m_DisplayMesh = new Mesh(); m_DisplayMaterial = new Material(Shader.Find("ProBuilder/UnlitVertexColor")); m_DisplayMesh.hideFlags = HideFlags.DontSave; m_DisplayMaterial.hideFlags = HideFlags.DontSave; SceneView.duringSceneGui += OnSceneGUI; MeshSelection.objectSelectionChanged += OnObjectSelectionChanged; ProBuilderMesh.elementSelectionChanged += OnElementSelectionChanged; ProBuilderEditor.selectionUpdated += OnEditingMeshSelection; VertexManipulationTool.beforeMeshModification += OnBeginMeshModification; VertexManipulationTool.afterMeshModification += OnFinishMeshModification; RebuildBounds(); }
void OnEnable() { s_Instance = this; mesh = new Mesh(); material = new Material(Shader.Find("ProBuilder/UnlitVertexColor")); mesh.hideFlags = HideFlags.DontSave; material.hideFlags = HideFlags.DontSave; #if UNITY_2019_1_OR_NEWER SceneView.duringSceneGui += OnSceneGUI; #else SceneView.onSceneGUIDelegate += OnSceneGUI; #endif MeshSelection.objectSelectionChanged += OnObjectSelectionChanged; ProBuilderMesh.elementSelectionChanged += OnElementSelectionChanged; ProBuilderEditor.selectionUpdated += OnEditingMeshSelection; }