Skip to content

Commit 092c2c5

Browse files
authored
Merge pull request #23 from coryleach/dev
MultiSceneTransitionTask bugfix
2 parents 4161b60 + 800828b commit 092c2c5

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ Includes a SRP shader for blurring the background of UI panels.
2222
#### Using UnityPackageManager (for Unity 2019.3 or later)
2323
Open the package manager window (menu: Window > Package Manager)<br/>
2424
Select "Add package from git URL...", fill in the pop-up with the following link:<br/>
25-
https://github.com/coryleach/UnityGUI.git#3.0.6<br/>
25+
https://github.com/coryleach/UnityGUI.git#3.0.7<br/>
2626

2727
#### Using UnityPackageManager (for Unity 2019.1 or later)
2828

2929
Find the manifest.json file in the Packages folder of your project and edit it to look like this:
3030
```js
3131
{
3232
"dependencies": {
33-
"com.gameframe.gui": "https://github.com/coryleach/UnityGUI.git#3.0.6",
33+
"com.gameframe.gui": "https://github.com/coryleach/UnityGUI.git#3.0.7",
3434
...
3535
},
3636
}

Runtime/TransitionSystem/SceneTransitionTask.cs

+13-11
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ public async Task ExecuteAsync()
1818

1919
//Start Loads
2020
var loadOperation = SceneManager.LoadSceneAsync(SceneName, Mode);
21-
21+
2222
if (loadOperation == null)
2323
{
2424
return;
2525
}
26-
26+
2727
//Allow them all to load till 90% complete
2828
loadOperation.allowSceneActivation = false;
2929

@@ -34,13 +34,13 @@ public async Task ExecuteAsync()
3434
}
3535

3636
loadOperation.allowSceneActivation = true;
37-
37+
3838
while (!loadOperation.isDone)
3939
{
4040
Progress = loadOperation.progress;
4141
await Task.Yield();
4242
}
43-
43+
4444
ListPool<AsyncOperation>.Release(loadTasks);
4545

4646
//Load should now be complete
@@ -50,7 +50,7 @@ public async Task ExecuteAsync()
5050
await Task.Yield();
5151
}
5252
}
53-
53+
5454
public class MultiSceneTransitionTask : ITransitionTask
5555
{
5656
public string[] UnloadScenes { get; set; }
@@ -62,11 +62,11 @@ public async Task ExecuteAsync()
6262
{
6363
var unloadTasks = ListPool<AsyncOperation>.Get();
6464
var loadTasks = ListPool<AsyncOperation>.Get();
65-
65+
6666
Progress = 0;
67-
67+
6868
int totalScenes = UnloadScenes.Length + LoadScenes.Length;
69-
69+
7070
//Start Unloads
7171
for (var index = 0; index < UnloadScenes.Length; index++)
7272
{
@@ -100,13 +100,15 @@ public async Task ExecuteAsync()
100100
}
101101

102102
var waiting = false;
103-
103+
104104
do
105105
{
106106
await Task.Yield();
107107

108108
float sumProgress = 0;
109109

110+
waiting = false;
111+
110112
for (var index = 0; index < unloadTasks.Count; index++)
111113
{
112114
var unload = unloadTasks[index];
@@ -147,9 +149,9 @@ public async Task ExecuteAsync()
147149

148150
//Load should now be complete
149151
Progress = 1f;
150-
152+
151153
//Yielding one last time to let the 100% progress to be handled by presenter
152154
await Task.Yield();
153155
}
154156
}
155-
}
157+
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.gameframe.gui",
33
"displayName": "Gameframe.GUI",
4-
"version": "3.0.6",
4+
"version": "3.0.7",
55
"description": "This is a library of GUI helpers for UGUI \r\nIncludes a panel system that implements a navigation stack. \r\nIncludes a scene transition system. \r\nIncludes a SRP shader for blurring the background of UI panels.",
66
"keywords": [],
77
"author": {

0 commit comments

Comments
 (0)