Exemple #1
0
    public GameObject PopFromPool(string strPoolName, int iIndex)
    {
        //인덱스 기반 대출
        CharObjectPool pool = GetPoolItem(strPoolName);

        if (pool == null)
        {
            return(null);
        }

        return(pool.PopFromPoll(iIndex));
    }
Exemple #2
0
    public bool PushToPool(string strPoolName, int iIndex, GameObject item)
    {
        //인덱스 기반 반납
        CharObjectPool pool = GetPoolItem(strPoolName);

        if (pool.name == string.Empty)
        {
            return(false);
        }

        pool.PushToPool(item, iIndex, pool.transform);
        return(true);
    }
Exemple #3
0
 public void Set(string strPoolName, string [] strPrefabs, int [] iarr, int iObjectCount)
 {
     //서로 다른 오브젝트를 풀링으로 관리
     try
     {
         GameObject ObjectPool = ResourceLoader.CreatePrefab("Prefabs/CharObjectPool");   //오브젝트 풀링
         ObjectPool.name = strPoolName;
         CharObjectPool Pool = ObjectPool.GetComponent <CharObjectPool>();
         Pool.Init(strPrefabs, iarr, iObjectCount, Pool.transform);
         m_PoolManger.Add(Pool);
         //게임 오브젝트로 생성한 뒤 하위 컴포넌트로 셋팅
     }
     catch (NullReferenceException ex)
     {
         Debug.Log(ex);
     }
 }