Home

Awesome

Unity SceneReference

Keeps reference to a scene asset and tracks it's path in the editor, so it can be used in the game runtime.

Why

It's a well known fact that scenes can't be referenced like prefabs, textures etc. The Unity SceneManager API works with relative scene paths or names.

Use this class to avoid manually typing and updating scene path strings - it will try to do it for you as best as it can, including when <b>building the player</b>.

Installation

npm install -g openupm-cli
openupm add devlocker.utils.scenereference

openupm

{
  "dependencies": {
    "devlocker.utils.scenereference": "https://github.com/NibbleByte/UnitySceneReference.git#upm"
}

Features

Here is how it looks like:<br/> SceneReference

Here is how it looks in debug mode (what data is stored):<br/> SceneReferenceDebug

Here is how it looks in the code:<br/> SceneReferenceCode

Credits & Similar Projects

Using the ISerializationCallbackReceiver was inspired by the JohannesMP's SceneReference implementation.

Another solution that builds a runtime look-up table instead of storing paths in the data members is Eflatun.SceneReference.