SceneManager
Methods
addEventListener
addEventListener ( type : string, listener: function ) : null
Adds a listener to an event type.
Parameters:
Name | Type | Required | Description |
---|---|---|---|
type | string | Yes | The type of event to listen to. |
listener | function | Yes | The function that gets called when the event is fired. |
Returns:
Type: null
getCurrentFloor
async getCurrentFloor(): Promise<?FloorObject, Error>
Returns:
Type: Promise< ?FloorObject, Error >
hasEventListener
hasEventListener( type : string, listener: function ) : boolean
Checks if listener is added to an event type.
Parameters:
Name | Type | Required | Description |
---|---|---|---|
type | string | Yes | The type of event to listen to. |
listener | function | Yes | The function that gets called when the event is fired. |
Returns:
Type: null
isCurrentFloor
async isCurrentFloor(floor: SiteObject|FloorObject|null): Promise<boolean, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
floor | ?SiteObject FloorObject | Yes | - |
Returns:
Type: Promise<boolean, Error>
removeEventListener
removeEventListener ( type : string, listener: function ) : null
Removes a listener from an event type.
Parameters:
Name | Type | Required | Description |
---|---|---|---|
type | string | Yes | The type of the listener that gets removed. |
listener | function | Yes | The listener function that gets removed. |
Returns:
Type: null
setCurrentFloor
async setCurrentFloor(floor: SiteObject|FloorObject|null, animated = true : boolean): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
floor | ?SiteObject FloorObject | Yes | - | The floor to set, passing null is equivalent than passing the site |
animated | boolean | No | true |
Returns:
Type: Promise<void, Error>
Events
SCENE_EVENTS.floor.didChanged
The listener will receive the following parameters
Listener Parameters:
Name | Type | Description |
---|---|---|
data | object | |
data.previous | ?FloorObject | |
data.current | ?FloorObject |
SCENE_EVENTS.floor.willChanged
The listener will receive the following parameters
Listener Parameters:
Name | Type | Description |
---|---|---|
data | object | |
data.previous | ?FloorObject | |
data.current | ?FloorObject |