コード例 #1
0
    void Start()
    {
        cardSelector.Init();

        this.map = this.GetComponent <Tilemap>();

        // mapBounds = new BoundsInt(-3, -3, 0, 7, 7, 0); // 7x7
        mapBounds = new BoundsInt(-4, -4, 0, 9, 9, 0); // 9x9

        for (int y = mapBounds.yMin; y < mapBounds.yMax; y++)
        {
            for (int x = mapBounds.xMin; x < mapBounds.xMax; x++)
            {
                map.SetTile(new Vector3Int(x, y, 0), blankTile);
            }
        }
        Tile baseTile = new MarkedTile {
            sprite = spaceBase
        };
        Vector3Int basePos = showTutorial.Value
                         ? new Vector3Int(mapBounds.xMin, mapBounds.yMin, 0)
                         : new Vector3Int(Random.Range(mapBounds.xMin, mapBounds.xMax), Random.Range(mapBounds.yMin, mapBounds.yMax), 0);

        map.SetTile(basePos, baseTile);
        AddAdjecentPositionsToRequired(basePos);

        markedTileCreator = TerrainTileTextureCreator.Init(topBorder);

        score.Value = 0;
        colorOffset = Random.value;

        TurnCleanup();
    }