Skip to content

RYanXuDev/SaveSystemTutorial

Repository files navigation

教程视频链接 Tutorial Videos:

YouTube -

Part 1: https://youtu.be/tci13zedrzw

Part 2: https://youtu.be/1vOuh3_ZXRQ

Bilibili -

Part 1: https://www.bilibili.com/video/BV1nQ4y1z7pZ

Part 2: https://www.bilibili.com/video/BV1Cb4y1b71G


Unity Save System Tutorial

About Branch Version

The main branch is the initialization version of the tutorial project. You could download it and follow me along with the tutorial video. The completed branch is the final project for references. Feel free to download and use them.

In this tutorial you will learn:

  1. Two methods to implement data saving and loading in Unity Engine: (1) PlayerPrefs; (2) JSON;
  2. Their pros and cons
  3. Build a flexible save system

Unity存档系统教程

关于工程文件分支

Main分支的工程文件是教程项目的初始化版本。 你可以使用这个工程跟着我从头开始构建存档系统。 Completed分支的工程文件是教程结束时的完整工程项目,供大家参考。


在这个小教程中你将学到:

  1. 两种Unity引擎中常见的数据存取方法:(1) PlayerPrefs; (2) JSON;
  2. 它们的优缺点
  3. 构建一个高适用性的存档系统

参考资料 References Links

PlayerPrefs - Unity Documentation - https://docs.unity3d.com/ScriptReference/PlayerPrefs.html

MenuItem - Unity Documentation - https://docs.unity3d.com/ScriptReference/MenuItem.html

JSON - https://www.json.org/

JSON(中文) - https://www.json.org/json-zh.html

JSON Example - https://json.org/example.html

JsonUtility - Unity Documentation - https://docs.unity3d.com/ScriptReference/JsonUtility.html

JsonUtility.ToJson - Unity Documentation - Scripting API - https://docs.unity3d.com/ScriptReference/JsonUtility.ToJson.html

JsonUtility.FromJson - Unity Documentation - Scripting API - https://docs.unity3d.com/ScriptReference/JsonUtility.FromJson.html

JsonUtility.FromJsonOverwrite - Unity Documentation - Scripting API - https://docs.unity3d.com/ScriptReference/JsonUtility.FromJsonOverwrite.html

Script Serialization - Unity Documentation - Manual - https://docs.unity3d.com/Manual/script-Serialization.html

Application.persistentDataPath - Unity Documentation - Scripting API - https://docs.unity3d.com/ScriptReference/Application-persistentDataPath.html

Path.Combine - Microsoft .NET Docs - https://docs.microsoft.com/en-us/dotnet/api/system.io.path.combine

File.WriteAllText - Microsoft .NET Docs - https://docs.microsoft.com/en-us/dotnet/api/system.io.file.writealltext

File.ReadAllText - Microsoft .NET Docs - https://docs.microsoft.com/en-us/dotnet/api/system.io.file.readalltext

File.Delete - Microsoft .NET Docs - https://docs.microsoft.com/en-us/dotnet/api/system.io.file.delete

try-catch - Microsoft .NET Docs - https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/try-catch

About

How to build a flexible save system in Unity.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages