| || |
After just making a room spawn one after another in a line to under instantiation completely, the next challenge I set for myself was to create a true Array supported room spawning and swapping system.
This version utilizes an object known as the RoomManager, with a script sharing the same name.
This script create an array of gameobjects at incrementing positions known as the Room Roots this object will be just a coordinate position with no graphic but currently has a simple "halo" graphic.
Each of these when created has a Room script which creates a child Game Object at their position currently a simple cuboid.
Depending on the players position and facing, when you try to create a room, it access the Array accordingly and the Room script destroys its current child object and creates a new one according to the one the player chose via the GUI.