Class ProBuilderEditor
Manages the ProBuilder toolbar and tool mode.
Inherited Members
Namespace: UnityEditor.ProBuilder
Syntax
public sealed class ProBuilderEditor : EditorWindow, IHasCustomMenu
Properties
instance
Gets the active ProBuilderEditor window, or null if no instance is open. The ProBuilderEditor window appears in the Unity Editor as both the Edit Mode toolbar and the ProBuilder toolbar working together.
Declaration
public static ProBuilderEditor instance { get; }
Property Value
Type | Description |
---|---|
ProBuilderEditor |
selectMode
Gets and sets the current SelectMode value.
Declaration
public static SelectMode selectMode { get; set; }
Property Value
Type | Description |
---|---|
SelectMode |
Methods
AddItemsToMenu(GenericMenu)
Builds the context menu for the ProBuilder toolbar. This menu allows the user to toggle between text and button mode, and to change whether the toolbar is floating or dockable.
Declaration
public void AddItemsToMenu(GenericMenu menu)
Parameters
Type | Name | Description |
---|---|---|
GenericMenu | menu | The context menu |
Implements
Refresh(Boolean)
Rebuilds the mesh wireframe and selection caches.
Declaration
public static void Refresh(bool vertexCountChanged = true)
Parameters
Type | Name | Description |
---|---|---|
Boolean | vertexCountChanged | True if the number of vertices changed, which is the default value. |
ResetToLastSelectMode()
Changes the SelectMode to the last used mesh element mode.
Declaration
public static void ResetToLastSelectMode()
Events
afterMeshModification
Raised when vertex modifications are complete.
Declaration
public static event Action<IEnumerable<ProBuilderMesh>> afterMeshModification
Event Type
Type | Description |
---|---|
Action<IEnumerable<ProBuilderMesh>> |
beforeMeshModification
Raised immediately prior to beginning vertex modifications, when the ProBuilderMesh is in un-altered state. This is after ToMesh(MeshTopology) and Refresh(RefreshMask) have been called, but before Optimize(ProBuilderMesh, Boolean).
Declaration
public static event Action<IEnumerable<ProBuilderMesh>> beforeMeshModification
Event Type
Type | Description |
---|---|
Action<IEnumerable<ProBuilderMesh>> |
selectionUpdated
Raised any time the ProBuilder editor refreshes the selection. This is called every frame when interacting with mesh elements, and after any mesh operation.
Declaration
public static event Action<IEnumerable<ProBuilderMesh>> selectionUpdated
Event Type
Type | Description |
---|---|
Action<IEnumerable<ProBuilderMesh>> |
selectModeChanged
Raised when the EditLevel changes.
Declaration
public static event Action<SelectMode> selectModeChanged
Event Type
Type | Description |
---|---|
Action<SelectMode> |