A simple script which creates a SceneReference class, allowing Unity developers to drag and drop scene assets into exposed fields in the inspector. This circumvents using icky string names or build indexes and will dynamically access the same scene asset even when its build index or string name is changed.
- Download SceneReference.cs
- Place SceneReference.cs anywhere in the Assets folder, except the Editor folder.
- Use the SceneReference as a type in a script, for example: private SceneReference myScene;
- See ChangeScenesDemo.cs for a simple implementation.
