コード例 #1
0
 /// <summary>
 /// Remove the current mesh referenced by this object
 /// </summary>
 private void RemoveMesh()
 {
     Mesh = null;
     if (meshRenderer)
     {
         meshRenderer.enabled = false;
     }
 }
コード例 #2
0
        private MeshController GetOrCreateMesh(string name)
        {
            if (!meshes.ContainsKey(name))
            {
                var mesh = new MeshController(name);
                meshes[name] = mesh;
                return(mesh);
            }

            return(meshes[name]);
        }
コード例 #3
0
        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();
        }