Esempio n. 1
0
        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
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        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;
        }