Table of Contents

Method FindRequiredObjectOfType

Namespace
Gamelogic.Extensions
Assembly
Gamelogic.Extensions.dll

FindRequiredObjectOfType<T>()

Finds a component of the given type in the scene, or fail if no such component can be found.

[Version(3, 0, 0)]
public static T FindRequiredObjectOfType<T>() where T : Object

Returns

T

The component of type T if it exists.

Type Parameters

T

The type of component to find.

Remarks

Use this method when you know the object exists. You do not need to check if it exists, since this method does and throws an exception if it does not.

Exceptions

InvalidOperationException

no component of the required type exist in the scene.