Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gilzoide/unity-key-value-store-icloud-kvs
Key-Value Store implementation for Unity backed by iCloud KVS
https://github.com/gilzoide/unity-key-value-store-icloud-kvs
icloud ios key-value-store macos nsubiquitouskeyvaluestore tvos unity unity2d unity3d upm upm-package visionos
Last synced: about 14 hours ago
JSON representation
Key-Value Store implementation for Unity backed by iCloud KVS
- Host: GitHub
- URL: https://github.com/gilzoide/unity-key-value-store-icloud-kvs
- Owner: gilzoide
- License: unlicense
- Created: 2024-03-30T20:20:51.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-03-30T20:22:01.000Z (11 months ago)
- Last Synced: 2025-01-31T03:54:12.365Z (10 days ago)
- Topics: icloud, ios, key-value-store, macos, nsubiquitouskeyvaluestore, tvos, unity, unity2d, unity3d, upm, upm-package, visionos
- Language: C#
- Homepage:
- Size: 13.7 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# iCloud Key-Value Store for Unity
[Key-Value Store](https://github.com/gilzoide/unity-key-value-store) implementation backed by [iCloud KVS](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestore).## Features
- [ICloudKeyValueStore](Runtime/ICloudKeyValueStore.cs): Key-Value Store implementation that stores data using iCloud KVS.
- Supports macOS, iOS, tvOS and visionOS## Dependencies
- [Key-Value Store](https://github.com/gilzoide/unity-key-value-store): interface used by this implementation, which also provides custom object serialization out of the box.## How to install
Either:
- Install using the [Unity Package Manager](https://docs.unity3d.com/Manual/upm-ui-giturl.html) with the following URL:
```
https://github.com/gilzoide/unity-key-value-store-icloud-kvs.git#1.0.0-preview1
```
- Clone this repository or download a snapshot of it directly inside your project's `Assets` or `Packages` folder.## Basic usage
```cs
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");
```