fr.jeanf.scenemanagement 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,9 +8,9 @@ namespace jeanf.scenemanagement
8
8
  {
9
9
  public class LoadPersistentSubScenes : MonoBehaviour
10
10
  {
11
+ [SerializeField] private bool isLoadSequential = false;
11
12
  [Header("The order of subScenes will define their order of load")]
12
13
  public List<SubScene> subScenes;
13
-
14
14
 
15
15
  private bool _isPersistentLoadingComplete = false;
16
16
  public delegate void PersistentLoadingCompleteDelegate(bool status);
@@ -22,9 +22,21 @@ namespace jeanf.scenemanagement
22
22
  await UniTask.Delay(100);
23
23
  var world = World.DefaultGameObjectInjectionWorld.Unmanaged;
24
24
 
25
- for (var i = 0; i < subScenes.Count; i++)
25
+ if (isLoadSequential)
26
+ {
27
+ foreach (var s in subScenes)
28
+ {
29
+ await LoadSubScene(s, world);
30
+ }
31
+ }
32
+ else
26
33
  {
27
- await LoadSubScene(subScenes[i], world);
34
+ var loadTasks = new List<UniTask>();
35
+ foreach (var s in subScenes)
36
+ {
37
+ loadTasks.Add(LoadSubScene(s, world));
38
+ }
39
+ await UniTask.WhenAll(loadTasks);
28
40
  }
29
41
 
30
42
  LoadingInformation.LoadingStatus?.Invoke($"All subScenes loaded successfully.");
@@ -1899,6 +1899,7 @@ MonoBehaviour:
1899
1899
  m_Script: {fileID: 11500000, guid: 3d3a7108093b06a458fcb0c34bf4b3b5, type: 3}
1900
1900
  m_Name:
1901
1901
  m_EditorClassIdentifier:
1902
+ isLoadSequential: 0
1902
1903
  subScenes:
1903
1904
  - {fileID: 984702889}
1904
1905
  - {fileID: 2010461815}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fr.jeanf.scenemanagement",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "displayName": "Scene Management",
5
5
  "description": "This package contains two scene loading system, one is additive, the other is to load subscenes. \nBoth system are living side-by-side.\nThe dynamic systems handles the loading of all static content (environment) using subscenes.\nThe additive system loads scene additively depending on zone & region and upon scenario load/unload requests. Each region or scenario can have dependency that will remain loaded until either a region or a scenario became irrelevant.",
6
6
  "unity": "2021.3",