Exemple #1
0
 public override void SetSelection(MeshSelection selection)
 {
     m_vertexSelection.Clear();
     m_selection.Clear();
     foreach (KeyValuePair <ProBuilderMesh, IList <int> > kvp in selection.SelectedIndices)
     {
         m_vertexSelection.Add(kvp.Key, kvp.Value);
     }
 }
Exemple #2
0
        public override MeshSelection ClearSelection()
        {
            MeshSelection selection = new MeshSelection();

            foreach (ProBuilderMesh mesh in m_vertexSelection.Meshes)
            {
                selection.UnselectedIndices.Add(mesh, m_vertexSelection.GetVertices(mesh).ToArray());
            }

            m_vertexSelection.Clear();
            m_selection.Clear();

            if (selection.UnselectedIndices.Count > 0)
            {
                return(selection);
            }
            return(null);
        }
        public override void SetSelection(MeshSelection selection)
        {
            m_vertexSelection.Clear();
            m_selection.Clear();

            if (selection != null)
            {
                selection = selection.ToVertices(false);
                foreach (KeyValuePair <GameObject, IList <int> > kvp in selection.SelectedIndices)
                {
                    PBMesh pbMesh = kvp.Key.GetComponent <PBMesh>();
                    if (pbMesh.IsMarkedAsDestroyed)
                    {
                        continue;
                    }

                    m_vertexSelection.Add(kvp.Key.GetComponent <ProBuilderMesh>(), kvp.Value);
                }
            }
        }