private void Visualize(IfsDefinition definition) { MeshFilter meshFilter = GetComponent <MeshFilter>(); if (meshFilter == null) { meshFilter = gameObject.AddComponent <MeshFilter>(); } if (meshFilter.mesh == null) { meshFilter.mesh = new Mesh(); } VisualizeToMesh(meshFilter.mesh); }
private void Visualize(IfsDefinition definition) { if (mainCube == null) { mainCube = Instantiate <WireframeCubeVisualization>(CubePrefab, transform); mainCube.name = "main"; } ClearTransformedCubes(); if (definition == null) { return; } for (int i = 0; i < definition.Transforms.Count; ++i) { IfsTransform ifsTransform = definition.Transforms[i]; WireframeCubeVisualization transformedCube = Instantiate <WireframeCubeVisualization>(CubePrefab, transform); transformedCube.name = $"t{i}"; ifsTransform.ApplyToUnityTransform(transformedCube.transform); transformedCubes.Add(transformedCube); } }