Wings Engine

Lifecycle of an Extension

init()

This function is called when the bound component is initialized.

It is typically used to add event listeners, etc. It should be noted that at this point, other components might not have loaded yet, so you cannot access other components here.

1
init?(): void

ready()

This function is called when all components in the project have been initialized.

At this point, all components have been loaded and initialized, so it is safe to access other components here.

1
ready?(): void

update()

This function is called on every frame refresh.

Do not put time-consuming operations in this function, as it will cause the page to lag.

1
update?(): void
When the extension is not enabled, the update function will not be called.

destroy()

This function is called when the component is destroyed.

1
destroy?(): void