Esempio n. 1
0
    GameObject GetMapObjFromPool(int index)
    {
        TileMapObjPool pool;

        if (m_poolDic.TryGetValue(index, out pool))
        {
            return(pool.Get());
        }
        pool = new TileMapObjPool(m_objRefInfoAsset.gameObjectRef[index], Root.transform);
        m_poolDic.Add(index, pool);
        return(pool.Get());
    }
Esempio n. 2
0
    GameObject GetAlphaTexObjFromPool(string name, int x, int z)
    {
        if (string.IsNullOrEmpty(name))
        {
            return(null);
        }
        TileMapObjPool pool;

        if (m_alphaTexPoolDic.TryGetValue(name, out pool))
        {
            return(pool.Get(x, z));
        }
        pool = new TileMapObjPool(GetAlphaTexObj(name), ItemRoot, m_visiableCount_h * m_visiableCount_v);
        m_alphaTexPoolDic.Add(name, pool);
        return(pool.Get(x, z));
    }
Esempio n. 3
0
    GameObject GetMapObjFromPool(int index, int x, int z)
    {
        if (index == 0)
        {
            return(null);
        }
        TileMapObjPool pool;

        if (m_terPoolDic.TryGetValue(index, out pool))
        {
            return(pool.Get(x, z));
        }
        pool = new TileMapObjPool(GetTerrainObj(index), TerRoot, m_visiableCount_h * m_visiableCount_v);
        m_terPoolDic.Add(index, pool);
        return(pool.Get(x, z));
    }
Esempio n. 4
0
    GameObject GetItemObjFromPool(string name, int x, int z)
    {
        float _x = x - 0.5f;
        float _z = z - 0.5f;

        if (string.IsNullOrEmpty(name))
        {
            return(null);
        }
        TileMapObjPool pool;

        if (m_itemPoolDic.TryGetValue(name, out pool))
        {
            return(pool.Get(_x, _z));
        }
        pool = new TileMapObjPool(GetItemObj(name), ItemRoot, m_visiableCount_h * m_visiableCount_v);
        m_itemPoolDic.Add(name, pool);
        return(pool.Get(_x, _z));
    }