コード例 #1
0
    private void SetBotMapTile(int xPos, int yPos, CodeTile.Type type)
    {
        // Bottom map MUST have a tile (no clearing)
        switch (type)
        {
        case CodeTile.Type.grass:
            botMap.SetTile(new Vector3Int(xPos, yPos, 0), grass);
            break;

        case CodeTile.Type.road:
            botMap.SetTile(new Vector3Int(xPos, yPos, 0), road);
            break;

        case CodeTile.Type.water:
            botMap.SetTile(new Vector3Int(xPos, yPos, 0), water);
            break;

        case CodeTile.Type.building:
            botMap.SetTile(new Vector3Int(xPos, yPos, 0), grass);
            break;

        default:
            break;
        }
    }
コード例 #2
0
    private void SetMidMapTile(int xPos, int yPos, CodeTile.Type type)
    {
        bool clearTile = false;

        switch (type)
        {
        case CodeTile.Type.grass:
            clearTile = true;
            break;

        case CodeTile.Type.road:
            clearTile = true;
            break;

        case CodeTile.Type.water:
            clearTile = true;
            break;

        default:
            clearTile = true;
            break;
        }
        if (clearTile)
        {
            midMap.SetTile(new Vector3Int(xPos, yPos, 0), null);
        }
    }
コード例 #3
0
 public void SetTileMapTile(int xPos, int yPos, CodeTile.Type type)
 {
     SetBotMapTile(xPos, yPos, type);
     SetMidMapTile(xPos, yPos, type);
     SetTopMapTile(xPos, yPos, type);
 }