-
-
Notifications
You must be signed in to change notification settings - Fork 24
Getting started
BACK > Home
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.
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 thedependencies
list. - Open or focus on Unity Editor to resolve packages.
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
.
Creating a new Pool
Now there is an active Pool you can get an instance by calling TryGetInstance
.
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.
Returning an instance