コード例 #1
0
        public static void Import()
        {
            TileChooser.Reset();

            WeightListUtils.Add("Black", 10, TileChooser.ObstacleTileWeightList);
            WeightListUtils.Add("Black", 10, TileChooser.WallTileWeightList);

            WeightListUtils.Add("White", 10, TileChooser.RoadTileWeightList);
            WeightListUtils.Add("White", 10, TileChooser.CrossTileWeightList);
            WeightListUtils.Add("White", 10, TileChooser.RoomTileWeightList);
        }
コード例 #2
0
        public static void PrintMap(BlockInfo[,] BlockMap)
        {
            var Floor = GameObject.Find("Grid/Floor").GetComponent <Tilemap>();
            var Wall  = GameObject.Find("Grid/Wall").GetComponent <Tilemap>();

            for (int i = 0; i < BlockMap.GetLength(0); i++)
            {
                for (int j = 0; j < BlockMap.GetLength(1); j++)
                {
                    var info = BlockMap[i, j];
                    if (info.CanPass == false)
                    {
                        Wall.SetTile(new Vector3Int(i, j, 0), TileChooser.RandTile("Obstacle"));
                    }
                    else
                    {
                        Floor.SetTile(new Vector3Int(i, j, 0), TileChooser.RandTile("Cross"));
                    }
                }
            }
        }