Class AddressableSceneLoadData
Represents the data required to load a Unity scene using the Addressables system. Includes scene name, activation behavior, load mode, and post-load callback.
[Serializable]
public class AddressableSceneLoadData
- Inheritance
-
AddressableSceneLoadData
- Inherited Members
Constructors
AddressableSceneLoadData(string, Action<Scene>, LoadSceneMode, bool)
Constructs a new AddressableSceneLoadData instance.
public AddressableSceneLoadData(string sceneName, Action<Scene> onSceneLoaded = null, LoadSceneMode loadSceneMode = LoadSceneMode.Additive, bool activateOnLoad = true)
Parameters
sceneNamestringThe name of the scene to load.
onSceneLoadedAction<Scene>Callback invoked after scene is loaded (optional).
loadSceneModeLoadSceneModeThe mode to load the scene (default: Additive).
activateOnLoadboolWhether to activate the scene on load (default: true).
Fields
ActivateOnLoad
If true, sets the scene active when finished loading. If false, loading is blocked until activation.
[Tooltip("Sets the scene active when it finishes loaded. Blocks AddressableAsync loading when false.")]
public bool ActivateOnLoad
Field Value
LoadSceneMode
The mode used to load the scene (Single or Additive).
public LoadSceneMode LoadSceneMode
Field Value
- LoadSceneMode
OnSceneLoaded
Optional callback invoked after the scene is loaded.
public Action<Scene> OnSceneLoaded
Field Value
- Action<Scene>
SceneName
The name of the scene to load via Addressables.
public string SceneName
Field Value
Methods
Equals(object)
Determines whether the specified object is equal to the current instance. Two AddressableSceneLoadData objects are considered equal if their scene names match (ordinal comparison).
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
True if the scene names are equal; otherwise, false.
GetHashCode()
Returns a hash code for this instance based on the scene name.
public override int GetHashCode()
Returns
- int
Hash code for the scene name, or 0 if null.