Skip to main content
Version: Phaser v4.0.0

DataManagerPlugin

The Data Manager Plugin is a Scene Plugin that provides data storage and retrieval functionality for a Scene, integrated with the Scene lifecycle. It extends the base DataManager class with automatic event handling for Scene shutdown and destroy events, ensuring that stored data and event listeners are properly cleaned up when the Scene stops or is destroyed. It is accessed via scene.data within any Scene.

Constructor

new DataManagerPlugin(scene)

Parameters

nametypeoptionaldescription
scenePhaser.SceneNoA reference to the Scene that this DataManager belongs to.

Scope: static

Extends

Phaser.Data.DataManager

Source: src/data/DataManagerPlugin.js#L12
Since: 3.0.0

Inherited Members

From Phaser.Data.DataManager:


Public Members

scene

scene: Phaser.Scene

Description:

A reference to the Scene that this DataManager belongs to.

Source: src/data/DataManagerPlugin.js#L38
Since: 3.0.0


systems

systems: Phaser.Scenes.Systems

Description:

A reference to the Scene's Systems.

Source: src/data/DataManagerPlugin.js#L47
Since: 3.0.0


Inherited Methods

From Phaser.Data.DataManager:


Public Methods

destroy

<instance> destroy()

Description:

Destroys this DataManagerPlugin, calling the base DataManager destroy method, removing all Scene event listeners, and clearing all internal references. This is called automatically when the owning Scene is destroyed.

Overrides: Phaser.Data.DataManager#destroy

Source: src/data/DataManagerPlugin.js#L102
Since: 3.5.0