Click or drag to resize

VisualFindCreateAspectT Method

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 T FindCreateAspect<T>()
where T : new(), AspectComponentBase

Type Parameters

T
The type of the aspect.

Return Value

Type: T

[Missing <returns> documentation for "M:Demo3D.Visuals.Visual.FindCreateAspect``1"]

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