An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          



Made With Unity


License


Last Commit


Repo Size


Last Release

## 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();
}

```