Esempio n. 1
0
        private void AssertTilemapLayerExists(string layerName)
        {
            var levelRoot = GetGeneratedLevelRoot();
            var tilemaps  = RoomTemplateUtilsGrid2D.GetTilemaps(levelRoot);

            var tilemapLayer = tilemaps.SingleOrDefault(x => x.name == layerName);

            Assert.IsNotNull(tilemapLayer);
        }
Esempio n. 2
0
            public override void Run(DungeonGeneratorLevelGrid2D level)
            {
                foreach (var roomInstance in level.RoomInstances)
                {
                    var roomTemplateInstance = roomInstance.RoomTemplateInstance;

                    // Find floor tilemap layer
                    var tilemaps = RoomTemplateUtilsGrid2D.GetTilemaps(roomTemplateInstance);
                    var floor    = tilemaps.Single(x => x.name == "Floor").gameObject;

                    // Add floor collider
                    AddFloorCollider(floor);
                }
            }
Esempio n. 3
0
            public override void Run(DungeonGeneratorLevelGrid2D level)
            {
                foreach (var roomInstance in level.RoomInstances)
                {
                    var roomTemplateInstance = roomInstance.RoomTemplateInstance;

                    // Find floor tilemap layer
                    var tilemaps = RoomTemplateUtilsGrid2D.GetTilemaps(roomTemplateInstance);
                    var floor    = tilemaps.Single(x => x.name == "Floor").gameObject;

                    // Add floor collider
                    AddFloorCollider(floor);

                    // Add current room detection handler
                    floor.AddComponent <CurrentRoomDetectionTriggerHandler>();
                }
            }