public void StopEditingMesh() { if (target) { MeshTool.OnDeSelectTool(); target.SavedEditableMesh = new CfgData(editedMesh.Encode().ToString()); target = null; targetTransform = null; } Grid.DeactivateVertices(); GridNavigator.Inst().SetEnabled(false, false); UndoMoves.Clear(); RedoMoves.Clear(); }
public void EditMesh(PlaytimePainter painter, bool editCopy) { if (!painter || painter == target) { return; } if (target) { StopEditingMesh(); } target = painter; targetTransform = painter.transform; editedMesh = new EditableMesh(painter); if (editCopy) { painter.SharedMesh = new Mesh(); } Redraw(); InitGridIfNull(); UndoMoves.Clear(); RedoMoves.Clear(); UndoMoves.Add(editedMesh.Encode().ToString()); MeshTool.OnSelectTool(); }