From 9bb23bad13d0ece8fc55aad3fdf5c8f46b937a34 Mon Sep 17 00:00:00 2001 From: Robin Ruud Kristensen <robin1998@hotmail.no> Date: Wed, 30 Nov 2022 13:22:15 +0100 Subject: [PATCH] added spawning of chest prefab and active state set as false --- MrBigsock/Assets/Code/Map/TilemapGenerator.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/MrBigsock/Assets/Code/Map/TilemapGenerator.cs b/MrBigsock/Assets/Code/Map/TilemapGenerator.cs index 7b73c785..cc0850b2 100644 --- a/MrBigsock/Assets/Code/Map/TilemapGenerator.cs +++ b/MrBigsock/Assets/Code/Map/TilemapGenerator.cs @@ -15,6 +15,8 @@ namespace Bigsock [SerializeField] GameObject Door; [SerializeField] GameObject[] Enemy; [SerializeField] GameObject Boss; + //[SerializeField] GameObject Stairs; + [SerializeField] GameObject Chest; private int z_value = 0; private static int roomID = 0; @@ -197,6 +199,7 @@ namespace Bigsock fast++; } } + spawnChest(map, roomNr); SetMapBoundary(map, roomNr); } @@ -349,5 +352,20 @@ namespace Bigsock WallTop[roomNr].ClearAllTiles(); } } + + /* + public void SpawnStairs(int[,] bossRoom, int roomNr) + { + Instantiate(Stairs, new Vector3(FloorTilemap[roomNr].transform.position.x + bossRoom.GetUpperBound(0) / 2, + FloorTilemap[roomNr].transform.position.y + bossRoom.GetUpperBound(1) / 2, 0), Quaternion.identity); + } + */ + public void spawnChest(int[,] room, int roomNr) + { + Chest.tag = roomNr.ToString(); + Chest.SetActive(false); + Instantiate(Chest, new Vector3(FloorTilemap[roomNr].transform.position.x + room.GetUpperBound(0) / 2, + FloorTilemap[roomNr].transform.position.y + room.GetUpperBound(1) / 2, 0), Quaternion.identity); + } } } \ No newline at end of file -- GitLab