Skip to content
Snippets Groups Projects
Commit 9bb23bad authored by Robin Ruud Kristensen's avatar Robin Ruud Kristensen
Browse files

added spawning of chest prefab and active state set as false

parent 36b2a0a9
No related branches found
No related tags found
1 merge request!79Ruud1
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment