示例#1
0
        public void MergeWith(PlaytimePainter other)
        {
            EditableMesh edm = new EditableMesh();

            edm.Edit(other);

            if (UV2distributeRow > 1)
            {
                Vector2 tile   = Vector2.one / UV2distributeRow;
                int     y      = UV2distributeCurrent / UV2distributeRow;
                int     x      = UV2distributeCurrent - y * UV2distributeRow;
                Vector2 offset = tile;
                offset.Scale(new Vector2(x, y));
                edm.TileAndOffsetUVs(offset, tile, 1);
                UV2distributeCurrent++;
            }


            var tf = MeshManager.Inst.target.transform;

            triangles.AddRange(edm.triangles);

            foreach (var v in edm.meshPoints)
            {
                v.WorldPos = other.transform.TransformPoint(v.localPos);
                meshPoints.Add(v);
            }
        }
示例#2
0
 public MeshConstructor(EditableMesh edmesh, MeshPackagingProfile solution, Mesh fmesh)
 {
     profile = solution;
     edMesh  = edmesh;
     mesh    = fmesh;
     if (mesh == null)
     {
         mesh = new Mesh();
     }
 }
示例#3
0
        public void EditMesh(PlaytimePainter pntr, bool EditCopy)
        {
            if ((pntr == null) || (pntr == target))
            {
                return;
            }

            if (target != null)
            {
                DisconnectMesh();
            }

            target = pntr;

            edMesh = new EditableMesh();

            edMesh.Edit(pntr);

            if (EditCopy)
            {
                pntr.meshFilter.sharedMesh = new Mesh();
            }

            Redraw();

            pntr.meshNameHolder = edMesh.meshName;

            InitVertsIfNUll();

            SelectedLine = null;
            SelectedTris = null;
            SelectedUV   = null;

            undoMoves.Clear();
            redoMoves.Clear();

            undoMoves.Add(edMesh.Encode().ToString());

            MeshTool.OnSelectTool();
        }