Hierarchy

  • unknown
    • GameObject

Implements

  • unknown
  • IGameObject

Constructors

Accessors

  • get worldForward(): Vector3
  • Returns Vector3

  • get worldPosition(): Vector3
  • Returns Vector3

  • set worldPosition(val): void
  • Parameters

    • val: Vector3

    Returns void

  • get worldQuaternion(): Quaternion
  • Returns Quaternion

  • set worldQuaternion(val): void
  • Parameters

    • val: Quaternion

    Returns void

  • get worldRight(): Vector3
  • Returns Vector3

  • get worldRotation(): Vector3
  • Returns Vector3

  • set worldRotation(val): void
  • Parameters

    • val: Vector3

    Returns void

  • get worldScale(): Vector3
  • Returns Vector3

  • set worldScale(val): void
  • Parameters

    • val: Vector3

    Returns void

  • get worldUp(): Vector3
  • Returns Vector3

Methods

  • adds an existing component to this gameObject

    Type Parameters

    • T extends IComponent

    Parameters

    • comp: T | ConstructorConcrete<T>

    Returns void

  • creates a new component on this gameObject

    Type Parameters

    • T

    Parameters

    • type: ConstructorConcrete<T>

    Returns T

  • Returns any

  • Type Parameters

    • T

    Parameters

    • type: Constructor<T>

    Returns T

  • Type Parameters

    • T

    Parameters

    • type: Constructor<T>

    Returns T

  • Type Parameters

    • T

    Parameters

    • type: Constructor<T>

    Returns T

  • Type Parameters

    • T

    Parameters

    • type: Constructor<T>
    • Optional arr: T[]

    Returns T[]

  • Type Parameters

    • T

    Parameters

    • type: Constructor<T>
    • Optional arr: T[]

    Returns T[]

  • Type Parameters

    • T

    Parameters

    • type: Constructor<T>
    • Optional arr: T[]

    Returns T[]

  • Type Parameters

    • T

    Parameters

    • typeName: ConstructorConcrete<T>

    Returns T

  • Add an object to parent and also ensure all components are being registered

    Parameters

    • instance: any
    • parent: Object3D
    • Optional context: Context

    Returns void

  • Moves a component to a new object
    BEWARE: this does MOVE a component. If you want to add a new component use addNewComponent

    Type Parameters

    • T extends IComponent

    Parameters

    • go: any

      component to move the component to

    • instance: T | ConstructorConcrete<T>

      component to move to the GO

    Returns IComponent

  • Adds a new component to the provided object

    Type Parameters

    • T

    Parameters

    • go: any

      object to add the component to

    • type: ConstructorConcrete<T>

      type of the component to add

    • callAwake: boolean = true

      if true, the component will be added and awake will be called immediately

    Returns T

  • Destroys a object

    Parameters

    • instance: any

      object to destroy

    • recursive: boolean = true

      if true, all children will be destroyed as well. true by default

    • isRoot: boolean = true

    Returns void

  • Destroys a object on all connected clients (if you are in a networked session)

    Parameters

    • instance: any

      object to destroy

    • Optional context: Context
    • recursive: boolean = true

    Returns void

  • Type Parameters

    • T extends IComponent

    Parameters

    • typeName: Constructor<T>
    • Optional context: any
    • includeInactive: boolean = true

    Returns T

  • Type Parameters

    • T extends IComponent

    Parameters

    • typeName: Constructor<T>
    • Optional context: any

    Returns T[]

  • Run a callback for all components of the provided type on the provided object and its children (if recursive is true)

    Parameters

    • instance: Object3D

      object to run the method on

    • cb: ((comp) => any)

      callback to run on each component, "return undefined;" to continue and "return ;" to break the loop

        • (comp): any
        • Parameters

          Returns any

    • recursive: boolean = true

      if true, the method will be run on all children as well

    Returns any

    the last return value of the callback

  • Gets a component on the provided object

    Type Parameters

    • T extends IComponent

    Parameters

    • go: any
    • typeName: Constructor<T>

    Returns T

  • Type Parameters

    • T extends IComponent

    Parameters

    • go: any
    • typeName: Constructor<T>

    Returns T

  • Type Parameters

    • T extends IComponent

    Parameters

    • go: any
    • typeName: Constructor<T>

    Returns T

  • Type Parameters

    • T extends IComponent

    Parameters

    • go: any
    • typeName: Constructor<T>
    • arr: T[] = null

    Returns T[]

  • Type Parameters

    • T extends IComponent

    Parameters

    • go: any
    • typeName: Constructor<T>
    • arr: T[] = null

    Returns T[]

  • Type Parameters

    • T extends IComponent

    Parameters

    • go: any
    • typeName: Constructor<T>
    • arr: T[] = null

    Returns T[]

  • Type Parameters

    • T extends IComponent

    Parameters

    • go: any
    • typeName: ConstructorConcrete<T>

    Returns T

  • Creates a new instance of the provided object (like cloning it including all components and children)

    Parameters

    • instance: any

      object to instantiate

    • opts: InstantiateOptions = null

      options for the instantiation (e.g. with what parent, position, etc.)

    Returns GameObject

  • Creates a new instance of the provided object. The new instance will be created on all connected clients

    Parameters

    Returns GameObject

  • Invokes a method on all components that have a method matching the provided name

    Parameters

    • go: any

      object to invoke the method on all components

    • functionName: string

      name of the method to invoke

    • children: boolean = false
    • Rest ...args: any

    Returns void

  • Invokes a method on all components including children (if a method with that name exists)

    Parameters

    • go: any
    • functionName: string
    • Rest ...args: any

    Returns void

  • If the object is active in the hierarchy (e.g. if any parent is invisible or not in the scene it will be false)

    Parameters

    • go: Object3D

      object to check

    Returns boolean

  • If the object is active (same as go.visible)

    Parameters

    • go: Object3D

    Returns boolean

  • Parameters

    • go: Object3D

    Returns boolean

  • Parameters

    • instance: Object3D

    Returns boolean

  • Parameters

    • go: any

    Returns Generator<any, void, unknown>

  • Parameters

    • go: Object3D
    • instanced: boolean

    Returns void

  • Moves a component to a new object

    Type Parameters

    • T extends IComponent

    Parameters

    • go: any

      component to move the component to

    • instance: T | ConstructorConcrete<T>

      component to move to the GO

    Returns IComponent

  • Removes the object from its parent and deactivates all of its components

    Parameters

    • instance: any

    Returns void

  • Removes a component from its object

    Type Parameters

    • T extends IComponent

    Parameters

    • instance: T

      component to remove

    Returns T

  • Parameters

    • go: Object3D
    • active: boolean
    • processStart: boolean = true

    Returns void

Generated using TypeDoc
Mar 30, 2024