/// <summary> /// Remove the current mesh referenced by this object /// </summary> private void RemoveMesh() { Mesh = null; if (meshRenderer) { meshRenderer.enabled = false; } }
private MeshController GetOrCreateMesh(string name) { if (!meshes.ContainsKey(name)) { var mesh = new MeshController(name); meshes[name] = mesh; return(mesh); } return(meshes[name]); }
public void SetMesh(MeshController mesh) { Debug.Log($"Set {name} mesh to {mesh.Data.name}"); if (Mesh == mesh) { return; } Mesh = mesh; if (Mesh == null) { RemoveMesh(); return; } AddMesh(); }