Пример #1
0
        public static EditableMesh New(SkinnedMeshRenderer smr)
        {
            EditableMesh newOne = new EditableMesh();

            newOne.m_SMR = smr;
            return(newOne);
        }
Пример #2
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
        }
Пример #3
0
        //private EditableMesh(){}

        public static EditableMesh New(MeshFilter mf)
        {
            EditableMesh newOne = new EditableMesh();

            newOne.m_MF = mf;
            return(newOne);
        }
Пример #4
0
        public void Init(EditableMesh mesh, MeshSelection sel, EditorCursor cursor)
        {
            m_EditMesh  = mesh;
            m_MeshTr    = m_EditMesh.transform;
            m_Selection = sel;
            m_Cursor    = cursor;

            m_WorldPos = m_MeshTr.position;
            m_WorldRot = m_MeshTr.rotation;
            //m_PivotOp = PivotOp.Midian;
            //m_Orient = Orientation.Local;

            MeshUndoer.AddDeleMeshModified(this._OnMeshModified);
            m_Selection.evtSelectionChanged  += this._OnSelectionChanged;
            EditorCursor.evtCursorPosChanged += this._OnCursorPosChanged;
        }