示例#1
0
        public void Init(MeshSelection s, EditableMesh m)
        {
            m_Selection = s;
            m_EditMesh  = m;

            // connect events
            m_Selection.evtSelectionChanged += this.OnSelectionChanged;
            MeshUndoer.AddDeleMeshModified(this.OnMeshModified);

            m_VertMarker = new VertMarker();
            Material vertBillboardMat = AssetDatabase.LoadAssetAtPath(VertBillboardMatPath, typeof(Material)) as Material;

            Dbg.Assert(vertBillboardMat != null, "MeshMaker.Init: failed to load vertBillboard Material at {0}", VertBillboardMatPath);
            m_VertMarker.Init(vertBillboardMat, 0);

            m_EdgeMarker = new EdgeMarker();
            Material edgeMat = AssetDatabase.LoadAssetAtPath(EdgeMatPath, typeof(Material)) as Material;

            Dbg.Assert(edgeMat != null, "MeshMaker.Init: failed to load edge Material at {0}", EdgeMatPath);
            m_EdgeMarker.Init(edgeMat);
            _PrepareEdgeIndices();

            m_TriMarker = new TriMarker();
            m_TriMarker.Init();

            EUtil.SetEnableWireframe(m.renderer, false);
            //EditorUtility.SetSelectedWireframeHidden(m.renderer, true); //hide the wireframe
        }
示例#2
0
        public void Fini()
        {
            EditorUtility.SetSelectedWireframeHidden(m_EditMesh.renderer, false); //show the wireframe

            m_TriMarker.Fini();
            m_TriMarker = null;

            m_EdgeMarker.Fini();
            m_EdgeMarker = null;

            m_VertMarker.Fini();
            m_VertMarker = null;

            MeshUndoer.DelDeleMeshModified(this.OnMeshModified);
            m_Selection.evtSelectionChanged -= this.OnSelectionChanged;
        }