Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/smidgens/unity-data

Data abstraction wrappers for Unity
https://github.com/smidgens/unity-data

config data-abstraction not-affiliated-with-bryan-adams smidgenomics unity unity-data

Last synced: 27 days ago
JSON representation

Data abstraction wrappers for Unity

Awesome Lists containing this project

README

        

![](/.github/banner.png?raw=true "")
![](/.github/gallery.png?raw=true "")

# ℹī¸ Features

* ScriptableObject persistence for data.
* Data abstraction in code.
* Configure data sources in Inspector: static, asset, or function (reflection).
* 🤞 Reasonably lightweight.


# đŸ“Ļ Install

1. Open Package Manager
2. Paste git URL (`#`)


# 🚀 Usage

🧩 **Note**: To use plugin in code you need to add an assembly reference.

### Reading data

```cs
using Smidgenomics.Unity.Data;

public class VariableTest : MonoBehaviour
{
public Readable num1;
public Readable num2;

private void Awake()
{
Debug.Log("Number 1: " + num1.Value);
Debug.Log("Number 2: " + num2); // implicit conversion
}
}

```

### Custom types

```cs
using UnityEngine;
using System;
using Smidgenomics.Unity.Data;

[Serializable]
class MySerializedType
{
public int a, b, c;
}

// inherit from ScriptableValue<>
class MyCustomAsset : ScriptableValue { }
```