コード例 #1
0
 /// <summary>
 /// Adds meshes to the loaded mesh list.
 /// </summary>
 /// <param name="meshes">The meshes to add.</param>
 public void AddMeshes(IEnumerable <MeshInfo> meshes)
 {
     m_meshes.ForEach(m => m.IsSelected = false);
     m_meshes.AddRange(meshes);
     MeshesAdded?.Invoke(meshes);
     MeshesChanged?.Invoke(m_meshes);
 }
コード例 #2
0
        /// <summary>
        /// Removes a mesh from the loaded mesh list.
        /// </summary>
        /// <param name="meshes">The meshes to remove.</param>
        public void RemoveMeshes(IEnumerable <MeshInfo> meshes)
        {
            // remove meshes from selection
            foreach (MeshInfo mesh in meshes)
            {
                mesh.IsActive   = false;
                mesh.IsSelected = false;
                m_meshes.Remove(mesh);
            }

            // notify that there are new meshes
            MeshesChanged?.Invoke(m_meshes);

            // notify each mesh's removal
            foreach (MeshInfo mesh in meshes)
            {
                MeshRemoved?.Invoke(mesh);
            }
        }