https://github.com/unity-package/object-pooling-unity
Object Pooling for Unity - Easy to use
https://github.com/unity-package/object-pooling-unity
object-pool object-pooling unity unity3d
Last synced: 9 months ago
JSON representation
Object Pooling for Unity - Easy to use
- Host: GitHub
- URL: https://github.com/unity-package/object-pooling-unity
- Owner: wolf-org
- License: mit
- Created: 2024-06-27T10:20:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-27T09:24:39.000Z (over 1 year ago)
- Last Synced: 2024-08-28T09:43:20.553Z (over 1 year ago)
- Topics: object-pool, object-pooling, unity, unity3d
- Language: C#
- Homepage:
- Size: 8.79 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## What
- Object-Pooling for game unity is very easy to use
## How To Install
### Add the line below to `Packages/manifest.json`
for version `1.0.1`
```json
"com.wolf-org.object-pooling":"https://github.com/unity-package/object-pooling-unity.git#1.0.1",
```
## Use
- Init Pool
```csharp
Pool.InitPool();
```
- Spawn/DeSpawn Object
```csharp
public GameObject prefab;
private GameObject ins;
void SpawnIns()
{
ins = Pool.Spawn(prefab);
}
void DeSpawnIns()
{
Pool.DeSpawn(ins);
}
```
Or
```csharp
public GameObject prefab;
private GameObject ins;
void SpawnIns()
{
ins = prefab.Spawn();
}
void DeSpawnIns()
{
ins.DeSpawn();
}
```