Пример #1
0
    void Start()
    {
        tilesManager.DrawTiles();
        Tile initTile = tilesManager.GetTileInCoords(originalPositionX, originalPositionZ);

        catController.InitCatInTile(initTile);
    }
Пример #2
0
    public void StepForward()
    {
        Tile newTile = null;

        switch (side)
        {
        case sides.FRONT:
            newTile = tilesManager.GetTileInCoords((int)tile.coords.x, (int)tile.coords.y + 1);
            break;

        case sides.RIGHT:
            newTile = tilesManager.GetTileInCoords((int)tile.coords.x + 1, (int)tile.coords.y);
            break;
        }
        if (newTile == null)
        {
            return;
        }
        tile = newTile;
        cat.transform.position = tile.transform.position;
    }