Beispiel #1
0
    public void Stow(PoolableEntity entity)
    {
        Transform folder;
        Type      t = entity.GetType();

        folder = this.poolingData.pools.Find(x => x.prefab.GetType() == t && Array.IndexOf(x.objects, entity) > -1).inactiveFolder;

        entity.Reset();
        entity.transform.parent = folder;
    }
Beispiel #2
0
    public void Stow(PoolableEntity entity)
    {
        PoolingData.Pool pool;
        Transform        folder;
        Type             t;
        int index;

        t     = entity.GetType();
        index = 0;

        do
        {
            pool = this.poolingDatas[index++].pools.Find(x => x.entity.GetType() == t && Array.IndexOf(x.entities, entity) > -1);
        }while(!pool.prefab && index < this.poolingDatas.Length);

        folder = pool.inactiveFolder;

        entity.Reset();
        entity.transform.parent = folder;
    }