Skip to content

Instantly share code, notes, and snippets.

@Densyakun
Created September 28, 2017 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Densyakun/43f0d953dbc2228c376e81aca506bb5b to your computer and use it in GitHub Desktop.
Save Densyakun/43f0d953dbc2228c376e81aca506bb5b to your computer and use it in GitHub Desktop.
【Unity】メッシュの複製コード
public static Mesh mesh_copy (Mesh mesh) {
Mesh m = new Mesh ();
m.vertices = mesh.vertices;
m.uv = mesh.uv;
m.uv2 = mesh.uv2;
m.uv3 = mesh.uv3;
m.uv4 = mesh.uv4;
m.triangles = mesh.triangles;
m.bindposes = mesh.bindposes;
m.boneWeights = mesh.boneWeights;
m.bounds = mesh.bounds;
m.colors = mesh.colors;
m.colors32 = mesh.colors32;
m.normals = mesh.normals;
m.subMeshCount = mesh.subMeshCount;
m.tangents = mesh.tangents;
return m;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment