Skip to main content

Class: EntityRemoveBeforeEventSignal

Allows registration for an event that fires when an entity is being removed from the game (for example, unloaded, or a few seconds after they are dead.)

Constructors

new EntityRemoveBeforeEventSignal()

private new EntityRemoveBeforeEventSignal(): EntityRemoveBeforeEventSignal

Returns

EntityRemoveBeforeEventSignal

Methods

subscribe()

subscribe(callback): (arg) => void

Parameters

ParameterTypeDescription
callback(arg) => voidFunction to call.

Returns

Function

Returns a closure that can be used in subsequent unsubscribe operations.

Parameters
ParameterType
argEntityRemoveBeforeEvent
Returns

void

Remarks

Will call your function every time an entity is being removed from the game.

This function can't be called in read-only mode.


unsubscribe()

unsubscribe(callback): void

Parameters

ParameterType
callback(arg) => void

Returns

void

Remarks

Unsubscribes your function from subsequent calls when an entity is being removed.

This function can't be called in read-only mode.