Home

Awesome

iCloud Key-Value Store for Unity

Key-Value Store implementation backed by iCloud KVS.

Features

Dependencies

How to install

Either:

Basic usage

using Gilzoide.KeyValueStore.ICloudKvs;
using UnityEngine;

// 1. Instantiate a ICloudKeyValueStore
var kvs = new ICloudKeyValueStore();


// 2. Set/Get/Delete values
kvs.SetBool("finishedTutorial", true);
kvs.SetString("username", "gilzoide");

Debug.Log("Checking if values exist: " + kvs.HasKey("username"));
Debug.Log("Getting values: " + kvs.GetInt("username"));
Debug.Log("Getting values with fallback: " + kvs.GetString("username", "default username"));
// Like C# Dictionary, this idiom returns a bool if the key is found
if (kvs.TryGetString("someKey", out string foundValue))
{
    Debug.Log("'someKey' exists: " + foundValue);
}

kvs.DeleteKey("someKey");