You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BREAKING CHANGE: The 4.x update consolidates the changes in the 3.x and simplifies a few more steps of the usage experience. It completely removes the ISceneLoader implementations and adds a static MySceneManager class so you don't have to manually control its lifecycle. Refer to the upgrade guide at https://scene-loader.mygamedevtools.com/docs/upgrades/from-3-to-4 for more details.
/// The <see cref="AdvancedSceneManager"/> is capable of managing both addressable and non-addressable scene operations.
12
+
/// The <see cref="CoreSceneManager"/> is capable of managing both addressable and non-addressable scene operations.
18
13
/// </summary>
19
-
publicclassAdvancedSceneManager:ISceneManager
14
+
publicclassCoreSceneManager:ISceneManager
20
15
{
21
16
publiceventAction<Scene,Scene>ActiveSceneChanged;
22
17
publiceventAction<Scene>SceneUnloaded;
@@ -32,15 +27,15 @@ public class AdvancedSceneManager : ISceneManager
32
27
ISceneData_activeScene;
33
28
34
29
/// <summary>
35
-
/// Creates an <see cref="AdvancedSceneManager"/> with no initial scene references.
30
+
/// Creates a <see cref="CoreSceneManager"/> with no initial scene references.
36
31
/// </summary>
37
-
publicAdvancedSceneManager():this(false){}
32
+
publicCoreSceneManager():this(false){}
38
33
/// <summary>
39
-
/// Creates a new <see cref="AdvancedSceneManager"/> with the option to add all loaded scenes to its management.
34
+
/// Creates a new <see cref="CoreSceneManager"/> with the option to add all loaded scenes to its management.
40
35
/// The advantage is that you can manage those scenes through this <see cref="ISceneManager"/> instead of having to
41
36
/// use the Unity <see cref="SceneManager"/>.
42
37
/// </summary>
43
-
publicAdvancedSceneManager(booladdLoadedScenes)
38
+
publicCoreSceneManager(booladdLoadedScenes)
44
39
{
45
40
if(!addLoadedScenes)
46
41
{
@@ -63,19 +58,19 @@ public AdvancedSceneManager(bool addLoadedScenes)
63
58
}
64
59
elseif(loadedSceneCount==0)
65
60
{
66
-
Debug.LogWarning("Tried to create an `AdvancedSceneManager` with all loaded scenes, but encoutered none. Did you create the scene manager on `Awake()`? If so, try moving the call to `Start()` instead.");
61
+
Debug.LogWarning("Tried to create a Scene Manager with all loaded scenes, but encoutered none. Did you create the Scene Manager on `Awake()`? If so, try moving the call to `Start()` instead.");
67
62
}
68
63
}
69
64
/// <summary>
70
-
/// Creates a new <see cref="AdvancedSceneManager"/> with the option to add a list of loaded scenes to its management.
65
+
/// Creates a new <see cref="CoreSceneManager"/> with the option to add a list of loaded scenes to its management.
71
66
/// The advantage is that you can manage those scenes through this <see cref="ISceneManager"/> instead of having to
thrownewArgumentException($"Trying to create an {nameof(AdvancedSceneManager)} with a null or empty array of initialization scenes. If you want to create it without any scenes, use the empty constructor instead.",nameof(initializationScenes));
73
+
thrownewArgumentException($"Trying to create an {nameof(CoreSceneManager)} with a null or empty array of initialization scenes. If you want to create it without any scenes, use the empty constructor instead.",nameof(initializationScenes));
79
74
}
80
75
81
76
intloadedSceneCount=initializationScenes.Length;
@@ -141,45 +136,34 @@ public Scene GetLoadedSceneByName(string name)
141
136
thrownewArgumentException($"[{GetType().Name}] Could not find any loaded scene with the name '{name}'.",nameof(name));
sceneInfo=sceneInfo??thrownewNullReferenceException($"[{GetType().Name}] Provided scene info is null.");
141
+
if(!sceneParameters.ShouldSetActive())
142
+
thrownewArgumentException($"[{GetType().Name}] You need to provide a SceneParameters object with a valid 'setIndexActive' value to perform scene transitions.",nameof(sceneParameters));
Copy file name to clipboardExpand all lines: Runtime/Interfaces/ISceneData.cs
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,13 @@ public interface ISceneData
37
37
/// </summary>
38
38
voidUpdateSceneReference();
39
39
40
+
/// <summary>
41
+
/// Returns whether this <see cref="ISceneData"/> can be matched by the given <paramref name="loadSceneInfo"/>.
42
+
/// If the <paramref name="loadSceneInfo"/> is equal to the <see cref="ISceneData.LoadSceneInfo"/> or has a direct reference to the scene, it returns true.
43
+
/// </summary>
44
+
/// <param name="loadSceneInfo"><see cref="ILoadSceneInfo"/> to validate a match.</param>
0 commit comments