Function getComponentInChildren

  • Searches for a given component type in the children of the given object.

    Type Parameters

    • T extends IComponent

    Parameters

    • obj: Object3D<Object3DEventMap>

      The object to start the search from - this object is also included in the search.

    • componentType: Constructor<T>

      The type of the component to search for.

    • Optional includeInactive: boolean

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

    Returns T | null

    The first component of the given type found in the children of the given object.

    Example

    const myComponent = getComponentInChildren(myObject, MyComponent);
    

Generated using TypeDoc