Download this documentation page as a PDF.
Contents
Importing and Exporting
Pure Pool supports importing and exporting of your pool settings to JSON files, for both individual pools and managers. Exporting your pool settings gives you peace of mind when making changes to your project, such as updating Pure Pool from the Asset Store, by letting you keep multiple backups of your settings.
Exporting
Both GameObjectPool
and GameObjectPoolManager
components can be exported to the file system. The process is largely the same, starting with opening the component's context menu, which can be accomplished either by context-clicking (most commonly left-clicking) on the titlebar area of the component, or by clicking on the cog icon on the right-most side of the component's titlebar. The option to export pool or manager settings is then available in the context menu.
GameObjectPool
To export the settings for a single GameObjectPool
component, choose "Export Pool Settings" from the component's context menu. A file dialog will appear for you to choose the destination folder and file name of the settings file. The default file name is the name of the pool, with the .json file extension. After choosing "Save" on the file dialog, the pool settings are serialised to JSON and written to the file.
GameObjectPoolManager
To export the settings for a GameObjectPoolManager
component, choose "Export Manager Settings" from the component's context menu.
A dialog will appear giving you the choice of exporting only the manager's settings, or also including the settings of all pools that are parented beneath the manager. If you wish to restore the pools as well as the manager's settings, make sure you choose "Export Pools".
After choosing the Export Mode, a file dialog will appear for you to choose the destination folder and file name. The default file name is the name of the manager, with a .json file extension. After clicking "Save" on the file dialog, the manager (and optionally, pool) settings are serialised into JSON format and stored in the file you specified.
Importing
As with exporting, both GameObjectPool
and GameObjectPoolManager
components can have their settings imported from the file system. Again, as with exporting, the process is largely the same for both of them. The option to import pool or manager settings is available in the context menu of the component.
GameObjectPool
To import the settings for a single GameObjectPool
component, choose "Import Pool Settings" from the component's context menu. A file dialog will appear for you to choose the JSON file that the settings were exported to. After choosing to open the file using the file dialog, another dialog will ask you to confirm that you wish to import the settings, as you will lose the existing settings in the process. After confirmation, the pool settings are imported into the pool.
GameObjectPoolManager
To import the settings for a GameObjectPoolManager
component, choose "Import Manager Settings" from the component's context menu. A file dialog will appear for you to choose the JSON file that the settings were exported to.
If the chosen file only contains settings for the manager, and not for pools beneath the manager, a dialog will ask you to confirm that you wish to import the settings. After confirmation, the settings are imported into the manager.
However, if the chosen file contains settings for the manager as well as its pools, a dialog will first ask you to choose whether you wish to import the settings only for the manager, or also for the pools as well.