コード例 #1
0
    public Transform CreateRepresentation(IPlaceable placeable)
    {
        //TODO replace this with good code
        if (!(placeable is GroundTile))
        {
            return(null);
        }
        GroundTile.GroundTileType type = ((GroundTile)placeable).GetTileType();

        Position   pos   = placeable.GetPosition();
        Position2D pos2D = pos.AsPosition2D();

        tileTypes [(int)type].transform.position = new Vector3(pos2D.GetX(), pos2D.GetY(), 0);
        Transform newTile = GameObject.Instantiate(tileTypes [(int)type]);

        activeTiles.Add(newTile);
        return(newTile);
    }