Skip to content

Getting started

Matt Dean edited this page Jan 15, 2020 · 5 revisions

BACK > Home


Welcome to kPooling!

This page explains how to get started using kPooling in your project. This tool is API only and assumes some previous programming experience. For more information on how to use kPooling see Scripting API.

Installing kPooling

kPooling is a package. Using this tool requires manual modification of your project's package manifest.

  • Open your project manifest file (MyProject/Packages/manifest.json).
  • Add "com.kink3d.pooling": "https://github.com/Kink3d/kPooling.git" to the dependencies list.
  • Open or focus on Unity Editor to resolve packages.

Pooling GameObjects

By default kPooling supports pooling for GameObjects. To add support for more types see Scripting API.

You can create a new pool by calling CreatePool.

alt text Creating a new Pool

Now there is an active Pool you can get an instance by calling TryGetInstance.

alt text Getting a new instance

When you are done with an instance you can return it by calling ReturnInstance. This call requires the original key the instance was returned with, so it can be returned to the correct Pool.

alt text Returning an instance

Clone this wiki locally