[Unity 3D game development] Introduction to the method of using NoSQL database in Unity

As the size and functions of the game continue to superimpose, the data in the game becomes more and more complex, which includes not only data such as game archives generated by players, such as the number of levels, gold coins, etc., but also game configuration data, such as each off configuration. Although Unity provides PlayerPrefs for storing user data, it is only suitable for small amounts of data. Once the data becomes complex, PlayerPrefs becomes a disaster.

NoSQL database

For projects that require clients to store data, a local database is the optimal solution in this case. There are various types of data that need to be saved in Unity , and many of them are asset content and not just binary. NoSQL databases are obviously more suitable for Unity. LiteDB is such a local database. It is 100% based on C# development, free and open source, and can be directly imported into Unity for use. .

1. Import Unity

1. Use VS to open the Unity project.

2. Enter the Nuget package manager VS to find the tool--Nuget package manager--package manager console

3. Install the LiteDB installation script

NuGet Gallery | LiteDB 5.0.15

Install-Package LiteDB -Version 5.0.11

Enter and press Enter to install

4. Import Unity project

Just use Nuget to download the latest package, and then import it into the Unity project. Import LiteDB.dll and LiteDB.xml together into the Plugins path of the Unity project.

5. Use Unity to regenerate the VS project

Delete the original VS project file in the project and regenerate it to generate a reference to the dll file.

6. Specify dependent scripts

In order to avoid Unity's code clipping, create link.xml under the Unity project path

2. Use LiteDB

Unity calls as follows

3. The final effect

 

4. 3DCAT real-time cloud rendering provides a solid foundation for cloud games

With the industry-leading enterprise-level one-stop cloud game platform solution, 3DCAT will continue to build ultra-low-latency edge computing nodes across the country to ensure the smoothness of platform cloud games. While providing gamers with ultra-high-definition cloud game services, 3DCAT brings professional-level exquisite picture quality and dynamic rendering effects to gamers by virtue of its high-speed bandwidth and fast response characteristics. Anytime, anywhere, click and play.

In the long-term development in the future, in addition to digging deep into the game content, the cloud game platform will be derived from the upstream and downstream of the game industry chain to expand the game development and distribution business . Universe Community + content is rendered on the cloud, and pushed to the terminal in real time through the network and streaming technology. To meet the needs of users for cross-terminal, interactive, ultra-high-definition, immersive, and online social access anytime, anywhere.

Register now and get 79 minutes of free real-time cloud rendering experience! Click to register

The content of this article "[Unity 3D Game Development] Introduction to the Method of Using NoSQL Database in Unity" is compiled and released by 3DCAT real-time cloud rendering solution provider . If you need to reprint, please indicate the source and link: [Unity 3D Game Development] Using NoSQL in Unity Introduction to database methods

Guess you like

Origin blog.csdn.net/RealTime_3DCAT/article/details/129091848