Class Drawing3dManager
Singleton MonoBehaviour that manages all active Drawing3d instances, refreshes dirty drawings each LateUpdate, and renders 3D labels via OnGUI.
Inherited Members
Namespace: Unity.SimulationPro.Foundation.Visualizations
Assembly: Unity.SimulationPro.Foundation.Visualizations.dll
Syntax
public class Drawing3dManager : MonoBehaviour
Properties
UnlitColorAlphaMaterial
Gets the unlit alpha-blended color material used for semi-transparent mesh instances.
Declaration
public Material UnlitColorAlphaMaterial { get; }
Property Value
| Type | Description |
|---|---|
| Material |
UnlitColorMaterial
Gets the unlit solid-color material used for opaque mesh instances.
Declaration
public Material UnlitColorMaterial { get; }
Property Value
| Type | Description |
|---|---|
| Material |
UnlitPointCloudMaterial
Gets the point cloud cutout material used by PointCloudDrawing instances.
Declaration
public Material UnlitPointCloudMaterial { get; }
Property Value
| Type | Description |
|---|---|
| Material |
UnlitVertexColorMaterial
Gets the unlit vertex-color material used as the default material for Drawing3d instances.
Declaration
public Material UnlitVertexColorMaterial { get; }
Property Value
| Type | Description |
|---|---|
| Material |
instance
Gets the singleton Drawing3dManager instance, creating one automatically in the editor if none exists in the scene.
Declaration
public static Drawing3dManager instance { get; }
Property Value
| Type | Description |
|---|---|
| Drawing3dManager |
Methods
AddDirty(Drawing3d)
Marks a Drawing3d as dirty so its mesh is rebuilt during the next LateUpdate.
Declaration
public void AddDirty(Drawing3d drawing)
Parameters
| Type | Name | Description |
|---|---|---|
| Drawing3d | drawing | The drawing to mark dirty. |
CreateDrawing(float, Material)
Creates a new Drawing3d instance, registers it with the singleton manager, and returns it.
Declaration
public static Drawing3d CreateDrawing(float duration = -1, Material material = null)
Parameters
| Type | Name | Description |
|---|---|---|
| float | duration | Lifetime in seconds before the drawing is automatically destroyed; pass |
| Material | material | The material to render the drawing with; if |
Returns
| Type | Description |
|---|---|
| Drawing3d | The newly created Drawing3d. |
DestroyDrawing(Drawing3d)
Removes a Drawing3d from the managed list and destroys its GameObject.
Declaration
public void DestroyDrawing(Drawing3d drawing)
Parameters
| Type | Name | Description |
|---|---|---|
| Drawing3d | drawing | The drawing to destroy. |
OnGUI()
Renders 3D labels for all managed drawings and removes any that have been destroyed.
Declaration
public void OnGUI()