All Projects → nvjob → simple-pool

nvjob / simple-pool

Licence: MIT License
#NVJOB Simple Pool. Pool for optimizing object loading. Unity Asset.

Programming Languages

HTML
75241 projects
C#
18002 projects
ShaderLab
938 projects

Projects that are alternatives of or similar to simple-pool

Object-Pooling-for-Unity
Object Pooling for Unity
Stars: ✭ 118 (+637.5%)
Mutual labels:  object-pool, unity-pool, object-pooling
nvjob-boids
#NVJOB Simple Boids (Flocks of Birds, Fish and Insects). Flocking Simulation. Free Unity Asset.
Stars: ✭ 55 (+243.75%)
Mutual labels:  unity-asset, nvjob
nvjob-sky-shader-simple-and-fast
#NVJOB Dynamic Sky. Sky Shaders. Free Unity Asset.
Stars: ✭ 103 (+543.75%)
Mutual labels:  unity-asset, nvjob
stc8
#NVJOB STC8 v 3.2 (Custom shader for Unity SpeedTree 8)
Stars: ✭ 17 (+6.25%)
Mutual labels:  unity-asset, nvjob
Unity-FPS-Counter
#NVJOB FPS Counter and Graph. Free Unity Asset.
Stars: ✭ 44 (+175%)
Mutual labels:  unity-asset, nvjob
JsonFormatter
Easy, Fast and Lightweight Json Formatter. (Serializer and Deserializer)
Stars: ✭ 26 (+62.5%)
Mutual labels:  unity-asset
DokoDemoPainter
DokoDemoPainter is a fast and easy texture painting solution for Unity and can paint on both regular and skinned meshes
Stars: ✭ 43 (+168.75%)
Mutual labels:  unity-asset
TsukiSuite
A toolsuite created to make Unity development easier
Stars: ✭ 23 (+43.75%)
Mutual labels:  unity-asset
MemoryPool
simple memory pool / thread safe / minimized context switching / Memory managed in 4 levels / Requirements(Windows xp~ / Visualstudio 2015)
Stars: ✭ 14 (-12.5%)
Mutual labels:  object-pool
pool
Go library that wraps http.Client to provide seamless higher-level connection pooling features
Stars: ✭ 39 (+143.75%)
Mutual labels:  pool
HiFramework.Unity
Based on component to manage project's core logic and module used in unity3d
Stars: ✭ 22 (+37.5%)
Mutual labels:  pool
ethersocial-pool
Open EthersocialNetwork Mining Pool based off the sammy007's open-ethereum-pool
Stars: ✭ 19 (+18.75%)
Mutual labels:  pool
arikado gridcoin pool
Simple gridcoin pool
Stars: ✭ 20 (+25%)
Mutual labels:  pool
t4-templates-unity3d
T4 Text Template Processor for Unity3D
Stars: ✭ 75 (+368.75%)
Mutual labels:  unity-asset
cryptonote-aeon-pool
AEON coin mining pool
Stars: ✭ 15 (-6.25%)
Mutual labels:  pool
gohive
🐝 A Highly Performant and easy to use goroutine pool for Go
Stars: ✭ 41 (+156.25%)
Mutual labels:  pool
dotnet-design-patterns-samples
The samples of .NET design patterns
Stars: ✭ 25 (+56.25%)
Mutual labels:  pool
unity-json-editor
A JSON Editor in the inspector. Preview and more information in README🙂
Stars: ✭ 64 (+300%)
Mutual labels:  unity-asset
agroal
The natural database connection pool
Stars: ✭ 92 (+475%)
Mutual labels:  pool
patterns
Good practices to create code in Java, open to other languages. ⚡
Stars: ✭ 14 (-12.5%)
Mutual labels:  object-pool

#NVJOB Simple Pool 1.2.1

nvjob.github.io/unity/nvjob-simple-pool

GitHub Logo

This is a simple pool for optimizing object loading.

Permanent creation and destruction of objects in your scene, very expensive in terms of memory management, use the Simple Pool object pool to save memory and improve performance.

All objects in the pool are loaded during initialization, and then retrieved from the pool and returned back to the pool without sacrificing performance.
The pool allows you to completely abandon Instantiate and Destroy after initialization.


Prerequisites

To work on the project, you will need a Unity version of at least 2019.1.8 (64-bit).

Information

Getting an object from a pool:

GameObject obj = SimplePool.GiveObj(0);

SimplePool.GiveObj() instead of using Instantiate(Object).
SimplePool.GiveObj(numElement)-> numElement - number of the Element in editor (SimplePool).

GitHub Logo

After all the transformations of the object, activate it:

obj.SetActive(true);

Return object to the pool, remove from the scene:

SimplePool.Takeobj(obj);

SimplePool.Takeobj() instead of using - Destroy(Object).
SimplePool.Takeobj(GameObject)-> GameObject - is an object that to be returned to the pool.

The number of elements in the editor (SimplePool):

SimplePool.numObjectsList

Checking that the pool is not empty:

GameObject obj = SimplePool.GiveObj(0);
if (obj != null)
{
}

If the pool is empty it will return null.

Example script:

using UnityEngine;

public class Example : MonoBehaviour
{
    GameObject obj;

    void Start()
    {
        if(SimplePool.numObjectsList == 0) obj = SimplePool.GiveObj(0);
        else obj = SimplePool.GiveObj(Random.Range(0, SimplePool.numObjectsList));
        if (obj != null)
        {
            obj.transform.SetPositionAndRotation(transform.position, transform.rotation);
            obj.transform.parent = transform;
            obj.SetActive(true);
            Invoke("DestroyObject", 5);
        }
    }

    void DestroyObject()
    {
        SimplePool.Takeobj(obj);
    }
}

Video manual:

https://www.youtube.com/watch?v=fhuhPnpSoJU


GitHub Logo


Authors: #NVJOB. Developer Nicholas Veselov. Разработчик Николай Веселов. Санкт-Петербург.

License: MIT License. Clarification of licenses.

Sorry: This project is currently frozen and cannot be supported or updated due to its complete non-profitability.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].