Worlds
A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds. 📕 Tutorial. 📘 API.
Extends
Implements
Properties
enabled
enabled:
boolean
=true
Overrides
list
A collection of worlds managed by this component. The key is the unique identifier (UUID) of the world, and the value is the World instance.
onAfterUpdate
readonly
onAfterUpdate:Event
<unknown
>
Implementation of
onBeforeUpdate
readonly
onBeforeUpdate:Event
<unknown
>
Implementation of
onDisposed
readonly
onDisposed:Event
<unknown
>
Implementation of
uuid
static
readonly
uuid:"fdb61dc4-2ec1-4966-b83d-54ea795fad4a"
A unique identifier for the component. This UUID is used to register the component within the Components system.
Methods
create()
create<
T
,U
,S
>():SimpleWorld
<T
,U
,S
>
Creates a new instance of a SimpleWorld and adds it to the list of worlds.
Type parameters
Type parameter | Value | Description |
---|---|---|
T extends BaseScene | BaseScene | The type of the scene, extending from BaseScene. Defaults to BaseScene. |
U extends BaseCamera | BaseCamera | The type of the camera, extending from BaseCamera. Defaults to BaseCamera. |
S extends BaseRenderer | BaseRenderer | The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer. |
Returns
SimpleWorld
<T
, U
, S
>
Throws
- Throws an error if a world with the same UUID already exists in the list.
delete()
delete(
world
):void
Deletes a world from the list of worlds.
Parameters
Parameter | Type | Description |
---|---|---|
world | World | The world to be deleted. |
Returns
void
Throws
- Throws an error if the provided world is not found in the list.
dispose()
dispose():
void
Disposes of the Worlds component and all its managed worlds. This method sets the enabled flag to false, disposes of all worlds, clears the list, and triggers the onDisposed event.
Returns
void
Implementation of
isConfigurable()
isConfigurable():
this is Configurable<any, any>
Whether is component is Configurable.
Returns
this is Configurable<any, any>
Inherited from
isDisposeable()
isDisposeable():
this is Disposable
Whether is component is Disposable.
Returns
this is Disposable
Inherited from
isHideable()
isHideable():
this is Hideable
Whether is component is Hideable.
Returns
this is Hideable
Inherited from
isResizeable()
isResizeable():
this is Resizeable
Whether is component is Resizeable.
Returns
this is Resizeable
Inherited from
isUpdateable()
isUpdateable():
this is Updateable
Whether is component is Updateable.
Returns
this is Updateable
Inherited from
update()
update(
delta
?):void
|Promise
<void
>
Parameters
Parameter | Type |
---|---|
delta ? | number |
Returns
void
| Promise
<void
>