Ejemplo n.º 1
0
    void GenerateNewMap(int xSize, int ySize)
    {
        if (xSize < 1 || ySize < 1)
        {
            Debug.Log("Map is too small.");
            return;
        }

        if (null == TileVisualizer.instance)
        {
            Debug.LogError("No TileVisualizer Found!");
            return;
        }

        ++currentMapNumber;

        currentMap                 = new GameObject().AddComponent <BoardMaster>();
        currentMap.name            = "New Map " + currentMapNumber;
        currentMap.basicTilePrefab = (Tile)Resources.LoadAssetAtPath("Assets/Prefabs/Tiles/Basic Tile.prefab", typeof(Tile));
        currentMap.tileSize        = 1;
        currentMap.tileSeparation  = tileSeparation;
        currentMap.Setup(xSize, ySize);
    }
Ejemplo n.º 2
0
    void GenerateNewMap(int xSize, int ySize)
    {
        if (xSize < 1 || ySize < 1) {
            Debug.Log("Map is too small.");
            return;
        }

        if (null == TileVisualizer.instance) {
            Debug.LogError("No TileVisualizer Found!");
            return;
        }

        ++currentMapNumber;

        currentMap = new GameObject().AddComponent<BoardMaster>();
        currentMap.name = "New Map " + currentMapNumber;
        currentMap.basicTilePrefab = (Tile)Resources.LoadAssetAtPath("Assets/Prefabs/Tiles/Basic Tile.prefab", typeof(Tile));
        currentMap.tileSize = 1;
        currentMap.tileSeparation = tileSeparation;
        currentMap.Setup(xSize, ySize);
    }