Showing posts with label Firebase. Show all posts
Showing posts with label Firebase. Show all posts

Data Saving Techniques for Unity3d Application

Data is one of the integral element in modern applications of Games, VR/AR or gamification. Unity3d, the most famous and most widely use game-engine provide you different options to save your game data in different ways. Once on a forum, a programmer asks the question that how to save data in unity3d?? and I  answered him with different options. I guess it is necessary to share the detail of the answer for future users. So, here is the list of different options for saving data for unity application. (we will like to update this article to add more techniques if you know anyone).



1. Platform-independent:

One way of saving data in Unity3D in a Platform-independent way is to use the PlayerPrefs class.


Here is the example to set a string and later get it through PlayerPrefs class.


Where the Data Store? Here is the chart:
Platform
Data stored at
Windows
Registry under HKCU\Software\[company name]\[product name] key
macOS
~/Library/Preferences folder, in a file named unity.[company name].[product name].plist, 
Win Phone 8
 application's local folder
WebGL
browser's IndexedDB
Linux
~/.config/unity3d/[CompanyName]/[ProductName]
Android
/data/data/pkg-name/shared_prefs/pkg-name.xml



* company and product names are the names set up in Project Settings

Reference Links:

·         PlayerPrefas Documentation

·   Tutorial PERSISTENCE - SAVING AND LOADING DATA using DontDestroyOnLoad, PlayerPrefs, and data serialization Video Tutorial by unity.

2. 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
You can also use third party solution like back4App and firebase.



3. Embedded Database:

SQLite (an embedded database for your app) is another great option for you get the Free Package, it is simple and easy (and my favorite) if you know SQL.

Free Web & Mobile App Development Training in Karachi


Want to be a world-class Software developer? But
  • You are a novice in programming and want to enter in the arena of software development?
  • You want to be the master of state of the art web technologies?
  • Want to be a master in Software, Web, and Mobile App Development?
  • Searching for well qualified and loyal faculty (skilled teachers in their respective development fields)?
  • Willing to earn the best training and Free. Yes, its Free, Free, Free?
  • You want your own choice of class/practice timing?
  • You have inspired with mobiles and web applications that you are using?
  • You want to be the part of billion-dollar ($,$$$,$$$,$$$) industry?

Important Announcement! Stay at Home but get online admission in PIAIC now - No fee for first quarter

Visit Saylani Mass IT Training Offical Web for Latest News

Welcome To R&P (Research and Program)

This site is specifically designed to share different researches, coding snippets, projects, tuts and articles related to computer science and software engineering. Our aim to provide you some great insight about Computer Science & its Researches, AI, Commercial Drone/UAVs, Programming (C#, Javascript, PHP, Python etc), Game Engine (Unity, Unreal etc) and Databases (SQLServer, MySQL, SQLite, Firebase etc).