omega-game-engine
    Preparing search index...

    An interface for behaviours that require pre and post-update and draw hooks. {EntityBehaviour}

    interface SceneEntityBehaviour {
        _className: string;
        _initialized: boolean;
        _serializationIgnoreKeys: string[];
        _uuid: string;
        active: boolean;
        name: string;
        parent: SceneEntity;
        renderLayer: RenderLayer;
        get className(): string;
        get transform(): Transform;
        get uuid(): string;
        afterDraw(): void;
        afterUpdate(): void;
        beforeDraw(): void;
        beforeUpdate(ellapsed: number): void;
        clone(): null | EntityBehaviour;
        deserializeAutomatically(jsonObject: JsonSerializedData): void;
        destroy(): void;
        draw(): void;
        fromJson(jsonObject: JsonSerializedData): void;
        getBaseJsonInfo(): JsonSerializedData;
        initialize(): boolean;
        serializeAutomatically(): JsonSerializedData;
        toJsonObject(): JsonSerializedData;
        update(elapsed: number): void;
        updateEditor(elapsed: number): void;
        [key: string]: any;
    }

    Hierarchy (View Summary)

    Indexable

    • [key: string]: any
    Index

    Properties

    _className: string
    _initialized: boolean = false

    A flag indicating if the behaviour has been initialized.

    _serializationIgnoreKeys: string[]
    _uuid: string
    active: boolean = true

    Indicates whether the behaviour is currently active. An inactive behaviour will not have its update method called.

    name: string = ''
    parent: SceneEntity

    The parent entity to which this behaviour is attached.

    renderLayer: RenderLayer = RenderLayer.OPAQUE

    The render layer this behaviour belongs to. This is used to determine the rendering order of the entity.

    Accessors

    • get transform(): Transform

      Gets the transform component of the parent entity. This provides easy access to the position, rotation, and scale of the entity.

      Returns Transform

    Methods

    • A lifecycle method called before the main update loop. *

      Parameters

      • ellapsed: number

        The time elapsed since the last frame in milliseconds. *

      Returns void

    • Updates the behaviour every frame. This method is called on every frame for active behaviours.

      Parameters

      • elapsed: number

        The time elapsed since the last frame in seconds.

      Returns void

    • Updates the behaviour specifically for editor mode. This method is called on every frame when the engine is in editor mode.

      Parameters

      • elapsed: number

        The time elapsed since the last frame in seconds.

      Returns void