component
Decorator that marks a class as a script component.
| Type | Name | Interface Description |
|---|---|---|
| Functions | component(): (target: T) => void | • Function: Decorator that marks a class as a script component. Script components can be attached to scene objects to add custom behavior. This decorator should be applied to classes that extend APJS.BasicScriptComponent. Returns Class decorator function |
Example
@component()
export class PlayerController extends APJS.BasicScriptComponent {
@serializeProperty
public moveSpeed: number = 5;
onUpdate(deltaTime: number): void {
// Movement logic here
}
}