new Destroy()
The Destroy component is responsible for destroying a Game Object.
- Source - gameobjects/components/Destroy.js, line 12
Members
-
<readonly> destroyPhase :boolean
-
As a Game Object runs through its destroy method this flag is set to true, and can be checked in any sub-systems or plugins it is being destroyed from.
- Source - gameobjects/components/Destroy.js, line 22
Methods
-
destroy(destroyChildren)
-
Destroys the Game Object. This removes it from its parent group, destroys the input, event and animation handlers if present and nulls its reference to
game
, freeing it up for garbage collection.If this Game Object has the Events component it will also dispatch the
onDestroy
event.Parameters:
Name Type Argument Default Description destroyChildren
boolean <optional>
true Should every child of this object have its destroy method called as well?
- Source - gameobjects/components/Destroy.js, line 33