Exemplo n.º 1
0
        public override void SetSelection(MeshSelection selection)
        {
            m_edgeSelection.Clear();
            m_selection.Clear();

            foreach (KeyValuePair <ProBuilderMesh, IList <Edge> > kvp in selection.SelectedEdges)
            {
                m_edgeSelection.Add(kvp.Key, kvp.Value);
            }
        }
Exemplo n.º 2
0
        public override MeshSelection ClearSelection()
        {
            MeshSelection selection = new MeshSelection();

            foreach (ProBuilderMesh mesh in m_edgeSelection.Meshes)
            {
                selection.UnselectedEdges.Add(mesh, m_edgeSelection.GetEdges(mesh).ToArray());
            }

            m_edgeSelection.Clear();
            m_selection.Clear();

            if (selection.UnselectedEdges.Count > 0)
            {
                return(selection);
            }
            return(null);
        }
Exemplo n.º 3
0
        public override void SetSelection(MeshSelection selection)
        {
            m_edgeSelection.Clear();
            m_selection.Clear();

            if (selection != null)
            {
                selection = selection.ToEdges(false);

                foreach (KeyValuePair <GameObject, IList <Edge> > kvp in selection.SelectedEdges)
                {
                    PBMesh pbMesh = kvp.Key.GetComponent <PBMesh>();
                    if (pbMesh.IsMarkedAsDestroyed)
                    {
                        continue;
                    }

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