Пример #1
0
    public static PoolToken GetPoolToken(GameObject g)
    {
        PoolToken gToken = g.GetComponent <PoolToken>();

        if (gToken == null)
        {
            throw new Exception("Can't find PoolToken on gameObject=[" + g.name + "] Are you sure you instantiate and delete all objects properly?");
        }
        return(gToken);
    }
Пример #2
0
    public static void Delete(GameObject g)
    {
        PoolToken token    = GetPoolToken(g);
        PoolType  poolType = token.poolType;

        if (poolType == PoolType.RPC || poolType == PoolType.PhotonView)
        {
            ObjectPoolRpcManager.Delete(g);
        }
        ObjectPoolManager.Delete(g);
    }