Game Development Reference
In-Depth Information
Chapter 10. An
Extensible
Game
Framework Pattern in Unity
In the final chapter of the topic, we will take all of the pieces we have developed so far
and assemble them into our final game! To do this, we will need to complete a frame-
work for loading and unloading individual scene files, connect that system into level
transition logic, and restructure a number of classes and Prefabs in our scene files so
that they work together using this pattern. We will also develop the code necessary
to ensure that the references that were created inside the editor can be reconnected
as necessary when scenes are streamed in. Having a consistent pattern with which
we can organize our scripts based on when they are needed gives us a reusable and
extendible pattern we can use to quickly add new levels to our game. Not only this,
but it can be used as a framework for future games that you develop!
In this chapter, we will cover the following topics:
• Load additively
• Using delete/load patterns
• Refactoring our work
Load additively
Recall from Chapter 4 , Mission One - Future Proofing the Code , that Unity3D sup-
ports the development of games that span multiple scene files. One benefit of splitting
a game up into multiple scene files is that we (as programmers) can assign different
lifespans to objects based on the scene file they belong to.
Search WWH ::




Custom Search