Game Development Reference
In-Depth Information
Refactoring level 2
At this point, our project is composed of two scene files; a main scene file that
contains the persistent
_global
GameObject hierarchy, and the
LEVEL1
scene file
that contains the
_level1
hierarchy for all of the level 1 scripts and objects. While
TESTBED2
and
TESTBED3
were designed to be played as standalone levels, our final
game framework is not. Hence, we now need to port and integrate the remaining
game content into this pattern.
1. Open the
TESTBED2
scene file into the editor. Locate the
_global
and
_level2
GameObjects in the
Hierarchy
tab.
2. Copy the
_level2
GameObject with
Ctrl
+
C
.
3. Create a new scene file named
LEVEL2
.
4. Paste the
_level2
object hierarchy into this scene with
Ctrl
+
V
.
5. You now have an appropriate scene file package for level 2. Let's repeat the
process for level 3.
6. Open the
TESTBED3
scene file into the editor. Locate the
_global
and
_level3
GameObject in the
Hierarchy
tab.
7. Copy the
_level3
GameObject with
Ctrl
+
C
.
8. Create a new scene file named
LEVEL3
.
9. Paste the
_level3
object hierarchy into this scene with
Ctrl
+
V
.
You now have an appropriate scene file package for level 3.