import { IStringDictionary, Undefinable } from "../utils/types"; import { Asset } from "./asset"; import { Entity, IRunEvent } from "./entity"; import { Thing } from "./thing"; export interface IComponent extends IRunEvent { isSingle: boolean; ioe: number; entity: Undefinable; nextStep: Function; update: (entity: Entity) => any; } export interface IComponentOption { entity?: Entity; type?: string; isSingle?: boolean; accessors?: IStringDictionary | string[]; } export declare abstract class Component extends Thing implements IComponent { protected options?: IComponentOption; entity: Undefinable; protected _object: any; /** * 此属性是否将资源的属性在组件中解释 * 比如材质是false 那么材质的属性指点点击关联的材质,才会显示材质的相应属性 * 而相机为true ,就是在属性面板直接显示资源的属性在inspector */ inspectorAsset: boolean; /** * 关联的资源 */ _asset: Undefinable | Asset[]; /** * 是否只允许存在一个 */ isSingle: boolean; /** * Index of Entity 在实体组件数组中的位置 */ ioe: number; label: string; constructor(options?: IComponentOption); init(): void; set needsUpdate(v: boolean); get object(): any; set object(val: any); beforeupdate(): void; afterupdate(): void; nextStep(entity: Entity): void; update(option?: any): any; }