示例#1
0
    public GameObject GetObject <T>(int index)
    {
        if (typeof(T) == typeof(Vehicle))
        {
            return(VehiclePool.GetObject(index));
        }

        else if (typeof(T) == typeof(Tile.GroundTile))
        {
            return(GroundTilePool.GetObject(index));
        }
        else if (typeof(T) == typeof(Tile.EndpointTile))
        {
            return(EndpointTilePool.GetObject(index));
        }

        else if (typeof(T) == typeof(Consumer))
        {
            return(ConsumerPool.GetObject(index));
        }
        else if (typeof(T) == typeof(Producer))
        {
            return(ProducerPool.GetObject(index));
        }

        return(null);
    }