Click or drag to resize

VisualFindCreateAspect Method (Type)

Finds an aspect if it exists or Adds a new one if it doesn't exist.

Namespace:  Demo3D.Visuals
Assembly:  Demo3D.Core (in Demo3D.Core.dll) Version: 15.0.2.11458
Syntax
C#
public virtual Object FindCreateAspect(
	Type type
)

Parameters

type
Type: SystemType
The type of the aspect.

Return Value

Type: Object

[Missing <returns> documentation for "M:Demo3D.Visuals.Visual.FindCreateAspect(System.Type)"]

Examples
C#
void FindCreateBoxWithPhysics(Visual visual) {
    // Add box renderer and physics to visual unless they already exist
    visual.FindCreateAspect<BoxRendererAspect>();
    visual.FindCreateAspect(typeof(BoxPhysicsAspect));
}
See Also