Exemplo n.º 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
        }
Exemplo n.º 2
0
        void OnEnable()
        {
            var os = targets;

            foreach (var aObj in os)
            {
                var o = (EmptyMarker)aObj;
                if (o.rd != null)
                {
                    o.rd.sharedMaterial = o.selectedMaterial;
                    EUtil.SetEnableWireframe(o.rd, false);
                    //EditorUtility.SetSelectedWireframeHidden(o.rd, true);
                }
            }
        }
Exemplo n.º 3
0
        public void Fini()
        {
            //EditorUtility.SetSelectedWireframeHidden(m_EditMesh.renderer, false); //show the wireframe
            EUtil.SetEnableWireframe(m_EditMesh.renderer, true);

            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;
        }