Freyja Data Asset
Freyja Data Asset provides a flexible and efficient way to manage data assets in Unity projects.
Features
Data Asset Definition: Create custom data assets for various types of data.
Data Asset Persistence: Persist data asset references and values across scenes.
Data Reference System: Easily reference and use data assets in scripts.
Requirements
Unity 2021.3.22.f1 or later
Odin Inspector 3.1.14.3
Dependencies
Name
Tags
Installation
Install from Unity Package Manager -> (
Window -> Package Manager -> Add package from git URL
)

Copy and Paste this URL link https://github.com/winartodev/Freyja-Data-Asset.git
Example Usage
Create Data Asset
using System;
[Serializable]
public class SwordData
{
public int Damage;
public int Strength;
}
using Freyja.DataAsset;
using UnityEngine;
[CreateAssetMenu(menuName = "Test/Runtime/" + nameof(SwordDataAsset))]
public class SwordDataAsset : DataAsset<SwordData>
{
}
Create Reference Data Asset
using System;
using Freyja.DataAsset;
[Serializable]
public class PlayerData
{
public string Name;
public DataReference<SwordData> SwordDataReference;
}
using Freyja.DataAsset;
using UnityEngine;
[CreateAssetMenu(menuName = "Test/Runtime/" + nameof(PlayerDataAsset))]
public class PlayerDataAsset : DataAsset<PlayerData>
{
}
Call Data Asset & Data Asset Reference
using UnityEngine;
public class DataAssetManager : MonoBehaviour
{
[SerializeField]
private PlayerDataAsset m_playerdataasset;
private void Start()
{
Debug.Log(m_playerdataasset.Value.Name);
Debug.Log(m_playerdataasset.Value.SwordDataReference.Value.Strength);
}
}
Last updated