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

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

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

        return(null);
    }