Share via


Entity.FindComponentOfType Method

Definition

Overloads

FindComponentOfType(ObjectType)

Tries to find a component of the given type that is attached to this entity.

FindComponentOfType<T>()

Find a component of a type on this Entity.

FindComponentOfType(ObjectType)

Tries to find a component of the given type that is attached to this entity.

public:
 Microsoft::Azure::RemoteRendering::ComponentBase ^ FindComponentOfType(Microsoft::Azure::RemoteRendering::ObjectType type);
public Microsoft.Azure.RemoteRendering.ComponentBase FindComponentOfType (Microsoft.Azure.RemoteRendering.ObjectType type);
member this.FindComponentOfType : Microsoft.Azure.RemoteRendering.ObjectType -> Microsoft.Azure.RemoteRendering.ComponentBase
Public Function FindComponentOfType (type As ObjectType) As ComponentBase

Parameters

type
ObjectType

Component type to search for, for instance MeshComponent.

Returns

The component if found, otherwise null

Remarks

Only one instance of each component type can be attached to each entity. Therefore this function either returns a single result, or null, if none is found. If you need to search the full entity sub-tree for components, use the FindComponentsOfTypeInHierarchy(ObjectType, Int32) function.

Applies to

FindComponentOfType<T>()

Find a component of a type on this Entity.

public:
generic <typename T>
 where T : Microsoft::Azure::RemoteRendering::ComponentBase T FindComponentOfType();
public T FindComponentOfType<T> () where T : Microsoft.Azure.RemoteRendering.ComponentBase;
member this.FindComponentOfType : unit -> 'T (requires 'T :> Microsoft.Azure.RemoteRendering.ComponentBase)
Public Function FindComponentOfType(Of T As ComponentBase) () As T

Type Parameters

T

Returns

T

The component if found, otherwise null

Applies to