public void Load(TriangleBlockData data, Material material) { for (var i = 0; i < 4; i++) { if (data.triangles[i]) { CreateTriangle(i, material); } } }
public TriangleBlockData ToData() { var data = new TriangleBlockData(); data.triangles = new bool[4]; data.position = this.transform.position; data.triangles[0] = !!triangles[0]; data.triangles[1] = !!triangles[1]; data.triangles[2] = !!triangles[2]; data.triangles[3] = !!triangles[3]; return(data); }