Class MeshSelection
Provides helper functions for selecting Unity objects and ProBuilder mesh elements.
Inherited Members
Namespace: UnityEditor.ProBuilder
Assembly: Unity.ProBuilder.Editor.dll
Syntax
[InitializeOnLoad]
public static class MeshSelection
Properties
Name | Description |
---|---|
activeMesh | Gets the ProBuilder mesh on the active selected GameObject. |
bounds | Gets the axis-aligned bounding box encompassing the selected elements. |
deep | Gets all selected ProBuilderMesh components, including those on the children of selected objects. |
selectedEdgeCount | Gets the sum of all currently selected edges on all currently selected ProBuilderMesh objects. |
selectedFaceCount | Gets the sum of all currently selected faces on all currently selected ProBuilderMesh objects. |
selectedObjectCount | Gets how many ProBuilderMesh components are currently selected. |
selectedSharedVertexCount | Gets the sum of all currently selected shared vertices on all currently selected ProBuilderMesh objects. |
selectedVertexCount | Gets the sum of all currently selected vertices on all currently selected ProBuilderMesh objects. |
top | Get all selected ProBuilderMesh components. Corresponds to Selection.gameObjects.Select(x => x.GetComponent<ProBuilderMesh>().Where(y => y != null);. |
totalCommonVertexCount | Gets the number of all selected vertices across the selected ProBuilder meshes, excluding coincident duplicates. |
totalEdgeCount | Gets the sum of all selected ProBuilderMesh edges. |
totalFaceCount | Gets the sum of all selected ProBuilderMesh faces. |
totalTriangleCountCompiled | Gets the sum of all selected ProBuilder compiled mesh triangles (3 indices make up a triangle, or 4 indices if topology is quad). |
totalVertexCount | Gets the sum of the vertices across all selected meshes. |
Methods
Name | Description |
---|---|
ClearElementAndObjectSelection() | Clears both the objects and ProBuilder mesh attribute selections. |
ClearElementSelection() | Clears all selected mesh attributes in the current selection. This means triangles, faces, and edges, but not objects. |
Events
Name | Description |
---|---|
objectSelectionChanged | Raised when the object selection changes. |