Game Development Reference
In-Depth Information
Saving data to disk
A better way to manage your games to save data is to serialize it to disk, a method you
will use to determine how fast and secure this is.
Instead of using PlayerPrefs , it is better to manage the saving and loading of your
player data to a disk (or the Web; see the following sections). Thankfully, Mono (the C#
engine behind Unity3D) and JS provide common functions to access the disk across all
the platforms that Unity supports.
Note
There are exceptions, however, due to platform limitations or specializations in some plat-
forms (such as Windows 8, where all disks access are accessed asynchronously). In these
cases, Unity provides special classes to access platform components, for example, the
UnityEngine.Windows namespace.
You can also write your disk access routines that are more platform-specific if you wish to
make them more performant, but this requires you to write an interface and your platform-
specific code for each routine (see Chapter 12 , Deployment and Beyond , for information
on DLL import).
Search WWH ::




Custom Search