在 Unity 游戏中保存数据的最佳方式 [英] Best way to save data in Unity game
问题描述
我想知道...在 Unity 游戏中保存数据的最佳方式是什么.JSON?如果是这样,如何?谢谢
以下是一些为 Unity 项目保存数据的不同方式和方法:
平台无关:一种以平台无关的方式在 Unity3D 中保存数据的方法是使用
以上摘自我的关于数据的博文Unity3d 应用程序的保存技巧.
I was wondering... What's the best way to save data in Unity games. JSONs? If so, how? Thanks
解决方案Here are some of the different Ways and Methods to Save data for Unity Projects:
Platform-Independent: One way of saving data in Unity3D in a Platform-independent way is to use the PlayerPrefs class. (Learn More 1, 2). PlayerPrefs is a static class and it is very easy to use but not reliable.
PERSISTENCE - SAVING AND LOADING DATA using DontDestroyOnLoad, PlayerPrefs, and data serialization Video Tutorial by unity.
Server Side: You can also use a Server for saving data (like a combination of PHP and MySQL Database). You can use it to save Score Data, user profile, etc., Learn More From Unity Wiki
For saving the in-game data to a Hard drive in a format that can be understood and loaded later on, use a .NET/Mono feature known as Serialization. Learn More
Simple JSON guide about Unity is available at Unity Wiki or officially you can see JSON serialization
SQLite (an embedded database for your app) is another great option for you to get the Free Package, it is simple and easy (and my favorite) if you know SQL.
Scriptable Object: its a data container. Useful for unchanging data. Suitable for large unchaning data and aamazing safe projects memory.
The above is taken from my blog post on Data Saving Techniques for Unity3d Applications.
这篇关于在 Unity 游戏中保存数据的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!