# Class: PluginManager

## Phaser. PluginManager

Phaser - PluginManager

#### new PluginManager(game)

  The Plugin Manager is responsible for the loading, running and unloading of Phaser Plugins.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `game` | Phaser.Game | A reference to the currently running game.

  Source:
    - core/PluginManager.js, line 17

### Members

#### game

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `game` | Phaser.Game | A reference to the currently running game.

  Source:
    - core/PluginManager.js, line 22

#### plugins

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `plugins` | array | An array of all the plugins being managed by this PluginManager.

  Source:
    - core/PluginManager.js, line 27

### Methods

#### add(plugin, parameter) → {Phaser.Plugin}

  Add a new Plugin into the PluginManager. The Plugin must have 2 properties: game and parent. Plugin.game is set to ths game reference the PluginManager uses, and parent is set to the PluginManager.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `plugin` | object | Phaser.Plugin |  | The Plugin to add into the PluginManager. This can be a function or an existing object.
  `parameter` | * | <repeatable> | Additional parameters that will be passed to the Plugin.init method.

  Source:
    - core/PluginManager.js, line 45

  ##### Returns:

  The Plugin that was added to the manager.

  Type
    Phaser.Plugin

#### destroy()

  Clear down this PluginManager, calls destroy on every plugin and nulls out references.

  Source:
    - core/PluginManager.js, line 273

#### postRender()

  Post-render is called after the Game Renderer and State.render have run. It only calls plugins who have visible=true.

  Source:
    - core/PluginManager.js, line 253

#### postUpdate()

  PostUpdate is the last thing to be called before the world render. In particular, it is called after the world postUpdate, which means the camera has been adjusted. It only calls plugins who have active=true.

  Source:
    - core/PluginManager.js, line 212

#### preUpdate()

  Pre-update is called at the very start of the update cycle, before any other subsystems have been updated (including Physics). It only calls plugins who have active=true.

  Source:
    - core/PluginManager.js, line 172

#### remove(plugin)

  Remove a Plugin from the PluginManager. It calls Plugin.destroy on the plugin before removing it from the manager.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `plugin` | Phaser.Plugin | The plugin to be removed.

  Source:
    - core/PluginManager.js, line 130

#### removeAll()

  Remove all Plugins from the PluginManager. It calls Plugin.destroy on every plugin before removing it from the manager.

  Source:
    - core/PluginManager.js, line 153

#### render()

  Render is called right after the Game Renderer completes, but before the State.render. It only calls plugins who have visible=true.

  Source:
    - core/PluginManager.js, line 233

#### update()

  Update is called after all the core subsystems (Input, Tweens, Sound, etc) and the State have updated, but before the render. It only calls plugins who have active=true.

  Source:
    - core/PluginManager.js, line 192