When level 2 signals level 3 to load (when the player pressed the level 3 pop up's Continue button), it signals for the _level2
Gameobject to be destroyed and the _level3
GameObject to be loaded from the LEVEL3
scene file. We must refactor the start up logic of _level3
so that we can find and connect some object references to GameObjects in the _global
hierarchy. To accomplish this, perform the following steps:
Create a new script named
Level3Extras
, and attach an instance of it to the_level3
GameObject. This script will be used to directly access certain GameObjects inside_level3
for enabling and disabling.Give the
Level3Extras
script the following single public GameObject reference. TheLevel3Extras
script needs a reference to thesetupLevel3
object so that it can connect this reference to the appropriate pop-up button later on in the script:public GameObject setupLevel3;
Drag-and-drop the
SetupLevel3
GameObject from the_level3
GameObject hierarchy into theSetupLevel3...