Note: This repo contains code enabling cross scene references. You can find the original repo here: Link
Two Unity components enabling inspector events to be called across scenes. Simply add a caller component in the fist scene, and a repeater component in another scene and reference the caller in the repeater. Now whenever the caller is invoked, the repeater will also be invoked (as oong as both scenes are open).
CrossSceneEventCaller Component:
CrossSceneEventRepeater Component:
Within the samples folder there are two example scenes.
The first scene (called LoadFirst) contains a plane and a single cube that can be rotated. This scene also contains a canvas with buttons for
- Start Spinning: Invokes the CrossSceneEventCaller script, with a UnityEvent that calls the SimpleRotator in scene 1 to start rotation.
- Stop Spinning: Invokes the CrossSceneEventCaller script, with a UnityEvent that calls the SimpleRotator in scene 1 to stop rotation.
- Load Scene: Calls the LoadScene method from within the SimpleSceneLoader script.
- Unload Scene: Calls the UnloadScene method from within the SimpleSceneLoader script.
The second scene (called LoadSecond) contains a single cube that can be rotated, alongside two CrossSceneEventRepeaters:
- Start Spinning: Links to a CrossSceneEventCaller script in scene 1, with a UnityEvent that calls the SimpleRotator in scene 2 to start rotation.
- Stop Spinning: Links to a CrossSceneEventCaller script in scene 1, with a UnityEvent that calls the SimpleRotator in scene 2 to stop rotation.
Game view with scene 1 open by itself:
Game view with scene 1 and scene 2 open:
This repo has a two licences, depending on the containing folder:
- Anything within the folder "CrossSceneReference" uses the Unity Companion License.
- Everything else uses the standard MIT License.



