Esempio n. 1
0
    private EntityInfo GetPoolable(Transform forEntity)
    {
        EntityInfo info = entityInfoPool.Where(e => !e.gameObject.activeInHierarchy).FirstOrDefault();

        if (info == null)
        {
            info = Instantiate(entityInfoOriginal, transform).GetComponent <EntityInfo>();
            entityInfoPool.Add(info);
        }

        info.Activate(forEntity);
        return(info);
    }