import type { EngineGlobalObject } from "../EngineGlobalObject"; import type { Component } from "./Component"; import type { ComponentConstructor } from "./ComponentConstructor"; import type { GameObjectBuilder } from "./GameObjectBuilder"; import { Transform } from "./Transform"; /** * base class for all entities in scenes * do not drive this class */ export declare class GameObject { private readonly _engineGlobalObject; private readonly _instanceId; private _activeInHierarchy; private _activeSelf; private readonly _transform; /** * add a child game object * @param gameObjectBuilder */ addChildFromBuilder(gameObjectBuilder: GameObjectBuilder): GameObject; private onChangeParent; /** * add a component to this game object * it can be failed depending on the disallowMultipleComponent or requiredComponent option * @param componentCtor * @returns if success, return the component instance */ addComponent(componentCtor: ComponentConstructor): T | null; /** * get component of componentCtor: ComponentConstructor in the GameObject * @param componentCtor * @returns if success, return the component instance */ getComponent(componentCtor: ComponentConstructor): T | null; /** * get all components in the GameObject */ getComponents(): Component[]; /** * get components of componentCtor: ComponentConstructor in the GameObject * @param componentCtor * @returns */ getComponents(componentCtor: ComponentConstructor): T[]; /** * returns the component of componentCtor: ComponentConstructor in the GameObject or any of its children using depth first search * @param componentCtor * @returns */ getComponentInChildren(componentCtor: ComponentConstructor): T | null; /** * returns all components in the GameObject or any of its children using depth first search */ getComponentsInChildren(): Component[]; /** * returns all components of componentCtor: ComponentConstructor in the GameObject or any of its children using depth first search * @param componentCtor */ getComponentsInChildren(componentCtor: ComponentConstructor): T[]; private _destroyed; /** * destroy the GameObject */ destroy(): void; private static destroyRecursively; private destroyEventProcess; /** * global engine object */ get engine(): EngineGlobalObject; /** * defines whether the GameObject is active in the Scene */ get activeInHierarchy(): boolean; private set activeInHierarchy(value); private setActiveInHierarchyWithEvent; /** * defines whether the GameObject is active in the Scene */ get activeSelf(): boolean; /** * defines whether the GameObject is active in the Scene */ set activeSelf(value: boolean); /** * get transform of the GameObject */ get transform(): Transform; /** * get name of the GameObject */ get name(): string; /** * set name of the GameObject */ set name(value: string); /** * get instance id of the GameObject */ get instanceId(): number; /** * if instantiate process is finished, this will be true */ get initialized(): boolean; /** * does the gameobject exist? */ get exists(): boolean; private checkGameObjectIsExist; }