private void RecreateCuboid(GeneratedCuboid targetCuboid) { float x, y, z; bool forceVertical; AssignSizeValues(targetCuboid, out x, out y, out z, out forceVertical); AbstractCuboidMeshGenerator meshGenerator; if (forceVertical) { meshGenerator = new VerticalCuboidMeshGenerator(x, y, z); } else { meshGenerator = AbstractCuboidMeshGenerator.ConstructOptimalGenerator(x, y, z); } meshGenerator.CreateCuboid(); Mesh newMesh = meshGenerator.GetMesh(); SetNewMesh(targetCuboid, newMesh); AdaptCollider(targetCuboid, meshGenerator); targetCuboid.Uvs = meshGenerator.GetUVs(); }
private void CreateCuboid() { AbstractCuboidMeshGenerator meshGenerator; if (forceVerticalMap) { meshGenerator = new VerticalCuboidMeshGenerator(x, y, z); } else { meshGenerator = AbstractCuboidMeshGenerator.ConstructOptimalGenerator(x, y, z); } meshGenerator.CreateCuboid(); meshGenerator.CreateNewObject(); meshGenerator.SetParent(Selection.activeTransform); List <Vector2> uvs = meshGenerator.GetUVs(); if (Selection.activeTransform == null) { output = SUCCESS_MESSAGE + ROOT_NAME + DOT_SPACE; } else { output = SUCCESS_MESSAGE + Selection.activeTransform.gameObject.name + DOT_SPACE; } if (generateUVMap) { UVBitmapGenerator generator = new UVBitmapGenerator(); output += generator.StoreUVMap(uvs, uvSize); AssetDatabase.Refresh(); } }