JUtils
A unity utilities library
JUtils.SceneReference Struct Reference

Reference a scene via its asset instead of its name. It can also give suggestions based on it being null / not in build More...

Public Member Functions

void LoadScene (LoadSceneMode mode=LoadSceneMode.Single)
 
AsyncOperation LoadSceneAsync (LoadSceneMode mode=LoadSceneMode.Single)
 
AsyncOperation UnloadSceneAsync ()
 

Properties

string sceneName [get]
 
string scenePath [get]
 
int buildIndex [get]
 

Detailed Description

Reference a scene via its asset instead of its name. It can also give suggestions based on it being null / not in build

namespace Example
{
public class Game : ScriptableObject
{
[SerializeField] private SceneReference _scene;
public IEnumerator LoadGameAsync(Game currentGame)
{
yield return currentGame._scene.UnloadSceneAsync();
yield return _scene.LoadSceneAsync(LoadSceneMode.Additive);
}
}
}

>

Member Function Documentation

◆ LoadScene()

void JUtils.SceneReference.LoadScene ( LoadSceneMode  mode = LoadSceneMode.Single)
inline

◆ LoadSceneAsync()

AsyncOperation JUtils.SceneReference.LoadSceneAsync ( LoadSceneMode  mode = LoadSceneMode.Single)
inline

◆ UnloadSceneAsync()

AsyncOperation JUtils.SceneReference.UnloadSceneAsync ( )
inline

Property Documentation

◆ buildIndex

int JUtils.SceneReference.buildIndex
get

◆ sceneName

string JUtils.SceneReference.sceneName
get

◆ scenePath

string JUtils.SceneReference.scenePath
get

The documentation for this struct was generated from the following file: