Example #1
0
 static public int createPool_s(IntPtr l)
 {
     try {
         System.String a1;
         checkType(l, 1, out a1);
         var ret = XGOStrKeyPool.createPool(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #2
0
    public XPool getPool(string str, XPoolType tp)
    {
        if (_pools.ContainsKey(str))
        {
            if (tp != _pools[str].PoolType)
            {
                XDebug.LogError("!!注意!!2次获取的同名pool类型不一样" + str);
            }
            return(_pools[str]);
        }

        XPool pool = null;

        if (tp == XPoolType.SINGLE)
        {
            pool = XSinglePool.createPool(str);
        }
        else if (tp == XPoolType.INTKEY)
        {
            pool = XIntKeyPool.createPool(str);
        }
        else if (tp == XPoolType.STRKEY)
        {
            pool = XStrKeyPool.createPool(str);
        }
        else if (tp == XPoolType.GOSINGLE)
        {
            pool = XGOSinglePool.createPool(str);
        }
        else if (tp == XPoolType.GOINTKEY)
        {
            pool = XGOIntKeyPool.createPool(str);
        }
        else if (tp == XPoolType.GOSTRKEY)
        {
            pool = XGOStrKeyPool.createPool(str);
        }

        if (pool != null)
        {
            pool.transform.SetParent(this.transform);
            _pools.Add(str, pool);
        }

        return(pool);
    }