@animech-public/playcanvas
Version:
PlayCanvas WebGL game engine
61 lines (60 loc) • 1.89 kB
TypeScript
/**
* Components are used to attach functionality on a {@link Entity}. Components can receive update
* events each frame, and expose properties to the PlayCanvas Editor.
*/
export class Component extends EventHandler {
/** @ignore */
static _buildAccessors(obj: any, schema: any): void;
/**
* Base constructor for a Component.
*
* @param {import('./system.js').ComponentSystem} system - The ComponentSystem used to create
* this Component.
* @param {import('../entity.js').Entity} entity - The Entity that this Component is attached
* to.
*/
constructor(system: import("./system.js").ComponentSystem, entity: import("../entity.js").Entity);
/**
* The ComponentSystem used to create this Component.
*
* @type {import('./system.js').ComponentSystem}
*/
system: import("./system.js").ComponentSystem;
/**
* The Entity that this Component is attached to.
*
* @type {import('../entity.js').Entity}
*/
entity: import("../entity.js").Entity;
/** @ignore */
buildAccessors(schema: any): void;
/** @ignore */
onSetEnabled(name: any, oldValue: any, newValue: any): void;
/** @ignore */
onEnable(): void;
/** @ignore */
onDisable(): void;
/** @ignore */
onPostStateChange(): void;
/**
* Access the component data directly. Usually you should access the data properties via the
* individual properties as modifying this data directly will not fire 'set' events.
*
* @type {*}
* @ignore
*/
get data(): any;
/**
* Sets the enabled state of the component.
*
* @type {boolean}
*/
set enabled(arg: boolean);
/**
* Gets the enabled state of the component.
*
* @type {boolean}
*/
get enabled(): boolean;
}
import { EventHandler } from '../../core/event-handler.js';