Persistent key-value storage for player progression. Store inventory, stats, game state, and user preferences securely in the cloud.
Store any serializable data (numbers, strings, booleans, JSON objects) mapped to a key.
Control who can read and write data with Public, Protected, and Read-Only permissions.
Modify counters safely without race conditions using Increment and Decrement operations.
Group related data into collections for easier organization and batch retrieval.
1using Ondara;2using UnityEngine;3
4public class PlayerDataExample : MonoBehaviour5{6 public async void SaveLoadExample()7 {8 // Save data9 await Ondara.PlayerData.Set("level", 10);10 await Ondara.PlayerData.Set("player_name", "Hero");11 await Ondara.PlayerData.Set("inventory", new string[] { "sword", "shield" });12
13 // Load data14 int level = await Ondara.PlayerData.Get<int>("level");15 string name = await Ondara.PlayerData.Get<string>("player_name");16 17 Debug.Log($"Level: {level}, Name: {name}");18 }19}int, float, bool, string
List<T>, Dictionary<K,V>
Any serializable C# class
Raw JSON strings
Instead of making 10 separate calls to save 10 items, create a single container class and save it all at once to reduce network requests.
Always use Increment and Decrement for currency or numeric stats to prevent race conditions when multiple updates happen rapidly.