Unclaimed Package Is this your package? Claim it to unlock full analytics and manage your listing.
Claim This Package

Install via UPM

Add to Unity Package Manager using this URL

https://www.pkglnk.dev/smartreference.git

README Markdown

Copy this to your project's README.md

Style
Preview
pkglnk installs badge
## Installation

Add **Smart Reference** to your Unity project via Package Manager:

1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/smartreference.git
```

[![pkglnk](https://www.pkglnk.dev/badge/smartreference.svg?style=pkglnk)](https://www.pkglnk.dev/pkg/smartreference)

README

Smart Reference

version 2.0.0

DocFX Build and Publish GitHub release (latest by date) openupm Unity Asset Store


Summary

Smart Reference is a Unity plugin that enables lazy loading asset references in ScriptableObject and MonoBehaviour. In Unity, referencing assets directly creates implicit dependencies. When the MonoBehaviour or ScriptableObject is loaded, all referenced assets are loaded immediately, which can lead to slow startup times and unnecessary memory usage, especially in data driven projects.

Smart Reference solves this by allowing you to reference assets without loading them upfront, while keeping the same editor workflow. Assets are only loaded when you use them at runtime.

Quick Start

1. Replace direct Unity references with SmartReference<T>

In the Inspector, SmartReference looks and behaves like a normal object reference.

using UnityEngine;
using SmartReference.Runtime;

public class MonsterData : ScriptableObject
{
    public SmartReference<GameObject> prefab;
    public SmartReference<Sprite> icon;
    public string description;
}

2. Initialize Smart Reference at startup

Choose the loader that matches your project setup.

Addressables (recommended)

using SmartReference.Runtime;

SmartReference.InitWithAddressablesLoader();

Resources

using SmartReference.Runtime;

SmartReference.InitWithResourcesLoader();

Custom Loader

SmartReference.InitWithCustomLoader(new MyCustomLoader());

Initialization must happen once, before any SmartReference is accessed.

3. Load assets when needed

Asynchronous Loading with UniTask (recommended)

var prefab = await monsterData.prefab.LoadAsyncUniTask();
Instantiate(prefab);

Asynchronous Loading with C# Async/Await

var prefab = await monsterData.prefab.LoadAsyncTask();
Instantiate(prefab);

Asynchronous Loading with Callbacks

monsterData.prefab.OnAsyncLoadComplete += go =>
{
    Instantiate(go);
};
monsterData.prefab.LoadAsync();

Synchronous Loading

var prefab = monsterData.prefab.Load();
Instantiate(prefab);

Supports

If you have questions or feedback:

Thank you for your support!

Comments

No comments yet. Be the first!