

Now, we're going to want to add some new functionality to this script, so immediately under where it says using System.Collections, add the following: using The resulting code should look like this: using UnityEngine And since it no longer inherits from MonoBehaviour, let's delete the Start and Update functions. Let's also remove the : MonoBehaviour part, because we don't need to attach it to a GameObject. We will reference this script from other scripts, so let's make it a static class by adding the word static between public and class. This script will handle all the saving and loading functionality.


For this, let's create a C# script and call it SaveLoad. The first thing we're going to do is to create some code that allows us to serialize our game data-that is, convert it to a format that can be saved and later restored. For information on saving game data in the Web Player, take a look at the official docs on Unity Web Player and browser communication. Note: This approach to saving and loading game data works on all platforms except for the Web Player.
#PLAY UNITY ANGRY BOTS HOW TO#
In this tutorial, you'll learn how to implement a simple system to create and manage savegames for your Unity games.
