Ejemplo n.º 1
0
 private Transform spawn()
 {
     if (_curPool == null)
     {
         Debug.LogError("cur pool is null");
         return(null);
     }
     return(_curPool.Spawn());
 }
Ejemplo n.º 2
0
    public Transform Spawn(string poolName, GameObject prefab = null)
    {
        UISimplePool pool = getPool(poolName);

        if (pool != null)
        {
            return(pool.Spawn());
        }
        else if (prefab != null)
        {
            pool = spawnPool(poolName, prefab);
            return(pool.Spawn());
        }
        else
        {
            Debug.LogError("prefab is null");
            return(null);
        }
    }
Ejemplo n.º 3
0
    public Transform Spawn(string poolName, string prefabPath)
    {
        UISimplePool pool = getPool(poolName);

        if (pool != null)
        {
            return(pool.Spawn());
        }
        else
        {
            GameObject prefab = createPerfab(prefabPath);
            if (prefab != null)
            {
                return(Spawn(poolName, prefab));
            }
            return(null);
        }
    }