Book Image

Extending Unity with Editor Scripting

Book Image

Extending Unity with Editor Scripting

Overview of this book

Table of Contents (18 chapters)
Extending Unity with Editor Scripting
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 7. Saving Data in a Persistent Way with Scriptable Objects

When you are in the final stage of the implementation of features for your video game, the next step is usually polishing and tweaking, investing most of the time to finding those special values that make your video game awesome and unique.

It is annoying when you find those values in your video game and suddenly you realize you were in Play mode. At this point, you have two options; you can either write down all these values, sometimes they are a lot, or start over.

In Unity, there is a special type of class called Scriptable Object, which is mainly used as a data container. One of its characteristics, if is used correctly, is the ability to save the changes you make to the scene during the Play mode.

You will learn how to create and use Scriptable Objects in Unity and use them to contain gameplay parameters from a level in Run & Jump.

The main topics that will be covered in this chapter are:

  • Creating the Scriptable Object...