Book Image

Unity Game Development Blueprints

By : John P. Doran
Book Image

Unity Game Development Blueprints

By: John P. Doran

Overview of this book

Table of Contents (16 chapters)
Unity Game Development Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Level editor – introduction


Of course, there can come a time when you want to save things other than just string, int, or float variables. To deal with complex data types, there are more things that we can do. Perform the following steps:

  1. We are going to first open up our 3D Platformer project we created back in Chapter 3, Side-scrolling Platformer. Open your gameplay scene (in the example code saved as Level1) from the link described in the project setup.

  2. As it currently stands, the ability to create our levels is inside our GameController script. For this project, however, we're going to extract that functionality and move it over to a new class. In Project Browser, go to the Scripts folder, and create a new C# script called LevelEditor. With that finished, open MonoDevelop.

  3. Once in MonoDevelop, click on the GameController.cs file, and highlight the level variable. Cut it (Ctrl + X) and paste it (Ctrl + V) as a declaration in the LevelEditor class.

  4. After this, remove the BuildLevel function...