• Searches the the scene for a component of the given type.
    If the contextOrScene is not provided, the current context is used.

    Type Parameters

    • T extends IComponent

    Parameters

    • type: Constructor<T>

      The type of the component to search for.

    • contextOrScene: any = undefined

      The context or scene to search in. If not provided, the current context is used.

    • includeInactive: boolean = true

      If true, also inactive components are returned. Default is true.

    Returns T | null

    The first component of the given type found in the scene or null if none was found.

    Example

    const myComponent = findObjectOfType(MyComponent);
    

Generated using TypeDoc