Skip to content

Commit ab2e9d9

Browse files
author
Cory Leach
committed
Removed ConfigureAwait calls for WebGL compatibility
1 parent c9fd82d commit ab2e9d9

13 files changed

Lines changed: 69 additions & 72 deletions

Runtime/PanelSystem/PanelStackController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public async Task TransitionAsync()
5858
}
5959

6060
//Load Views
61-
await LoadViews(showControllers).ConfigureAwait(true);
61+
await LoadViews(showControllers);
6262

6363
//Sort Views so things overlay property
6464
SortViews();
@@ -70,7 +70,7 @@ public async Task TransitionAsync()
7070
ListPool<IPanelViewController>.Release(activeControllers);
7171
activeControllers = showControllers;
7272

73-
await transitionTask.ConfigureAwait(true);
73+
await transitionTask;
7474
}
7575
catch (Exception e)
7676
{

Runtime/PanelSystem/PanelStackSystem.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void RemoveController(IPanelSystemController controller)
6666
/// <param name="controller"></param>
6767
public async void Push(IPanelViewController controller)
6868
{
69-
await PushAsync(controller).ConfigureAwait(false);
69+
await PushAsync(controller);
7070
}
7171

7272
/// <summary>
@@ -78,15 +78,15 @@ public async Task PushAsync(IPanelViewController controller)
7878
{
7979
stack.Add(controller);
8080
_needsTransition = true;
81-
await TransitionAsync().ConfigureAwait(false);
81+
await TransitionAsync();
8282
}
8383

8484
/// <summary>
8585
/// Pop the top panel off the stack
8686
/// </summary>
8787
public async void Pop()
8888
{
89-
await PopAsync().ConfigureAwait(false);
89+
await PopAsync();
9090
}
9191

9292
/// <summary>
@@ -102,7 +102,7 @@ public async Task PopAsync()
102102

103103
stack.RemoveAt(stack.Count - 1);
104104
_needsTransition = true;
105-
await TransitionAsync().ConfigureAwait(false);
105+
await TransitionAsync();
106106
}
107107

108108
/// <summary>
@@ -114,7 +114,7 @@ public async Task PopAsync(int count)
114114
{
115115
stack.RemoveRange(stack.Count-count,count);
116116
_needsTransition = true;
117-
await TransitionAsync().ConfigureAwait(false);
117+
await TransitionAsync();
118118
}
119119

120120
/// <summary>
@@ -123,7 +123,7 @@ public async Task PopAsync(int count)
123123
/// <param name="count">Number of panels to pop</param>
124124
public async void Pop(int count)
125125
{
126-
await PopAsync(count).ConfigureAwait(false);
126+
await PopAsync(count);
127127
}
128128

129129
/// <summary>
@@ -138,7 +138,7 @@ public async Task PopToIndexAsync(int index)
138138
stack.RemoveRange(index+1, stack.Count - (index+1));
139139
_needsTransition = true;
140140
}
141-
await TransitionAsync().ConfigureAwait(false);
141+
await TransitionAsync();
142142
}
143143

144144
/// <summary>
@@ -147,7 +147,7 @@ public async Task PopToIndexAsync(int index)
147147
/// <param name="index"></param>
148148
public async void PopToIndex(int index)
149149
{
150-
await PopToIndexAsync(index).ConfigureAwait(false);
150+
await PopToIndexAsync(index);
151151
}
152152

153153
/// <summary>
@@ -164,7 +164,7 @@ public async Task PopAndPushAsync(int popCount, params IPanelViewController[] co
164164
stack.RemoveRange(stack.Count-popCount,popCount);
165165
stack.AddRange(controllers);
166166
_needsTransition = true;
167-
await TransitionAsync().ConfigureAwait(false);
167+
await TransitionAsync();
168168
}
169169

170170
/// <summary>
@@ -174,7 +174,7 @@ public async Task PopAndPushAsync(int popCount, params IPanelViewController[] co
174174
/// <param name="controllers">list of controllers to push</param>
175175
public async void PopAndPush(int popCount, params IPanelViewController[] controllers)
176176
{
177-
await PopAndPushAsync(popCount, controllers).ConfigureAwait(false);
177+
await PopAndPushAsync(popCount, controllers);
178178
}
179179

180180
/// <summary>
@@ -191,7 +191,7 @@ public async Task PopAndPushAsync(int popCount, IPanelViewController controller)
191191
stack.RemoveRange(stack.Count-popCount,popCount);
192192
stack.Add(controller);
193193
_needsTransition = true;
194-
await TransitionAsync().ConfigureAwait(false);
194+
await TransitionAsync();
195195
}
196196

197197
/// <summary>
@@ -201,7 +201,7 @@ public async Task PopAndPushAsync(int popCount, IPanelViewController controller)
201201
/// <param name="controller">controller to push</param>
202202
public async void PopAndPush(int popCount, IPanelViewController controller)
203203
{
204-
await PopAndPushAsync(popCount, controller).ConfigureAwait(false);
204+
await PopAndPushAsync(popCount, controller);
205205
}
206206

207207
/// <summary>
@@ -213,7 +213,7 @@ public async Task PushAsync(params IPanelViewController[] controllers)
213213
{
214214
stack.AddRange(controllers);
215215
_needsTransition = true;
216-
await TransitionAsync().ConfigureAwait(false);
216+
await TransitionAsync();
217217
}
218218

219219
/// <summary>
@@ -222,7 +222,7 @@ public async Task PushAsync(params IPanelViewController[] controllers)
222222
/// <param name="controllers">array of panel view controllers</param>
223223
public async void Push(params IPanelViewController[] controllers)
224224
{
225-
await PushAsync(controllers).ConfigureAwait(false);
225+
await PushAsync(controllers);
226226
}
227227

228228
/// <summary>
@@ -235,7 +235,7 @@ public async Task ClearAndPushAsync(params IPanelViewController[] controllers)
235235
stack.Clear();
236236
stack.AddRange(controllers);
237237
_needsTransition = true;
238-
await TransitionAsync().ConfigureAwait(false);
238+
await TransitionAsync();
239239
}
240240

241241
/// <summary>
@@ -244,7 +244,7 @@ public async Task ClearAndPushAsync(params IPanelViewController[] controllers)
244244
/// <param name="controllers">array of panel view controllers</param>
245245
public async void ClearAndPush(params IPanelViewController[] controllers)
246246
{
247-
await ClearAndPushAsync(controllers).ConfigureAwait(false);
247+
await ClearAndPushAsync(controllers);
248248
}
249249

250250
/// <summary>
@@ -255,15 +255,15 @@ public async Task ClearAsync()
255255
{
256256
stack.Clear();
257257
_needsTransition = true;
258-
await TransitionAsync().ConfigureAwait(false);
258+
await TransitionAsync();
259259
}
260260

261261
/// <summary>
262262
/// Clear all panels from the stack
263263
/// </summary>
264264
public async void Clear()
265265
{
266-
await ClearAsync().ConfigureAwait(false);
266+
await ClearAsync();
267267
}
268268

269269
/// <summary>
@@ -275,15 +275,15 @@ public async Task ClearAndPushAsync(IPanelViewController viewController)
275275
stack.Clear();
276276
stack.Add(viewController);
277277
_needsTransition = true;
278-
await TransitionAsync().ConfigureAwait(false);
278+
await TransitionAsync();
279279
}
280280

281281
/// <summary>
282282
/// Clear all panels from the stack and then push a panel on top
283283
/// </summary>
284284
public async void ClearAndPush(IPanelViewController viewController)
285285
{
286-
await ClearAndPushAsync(viewController).ConfigureAwait(false);
286+
await ClearAndPushAsync(viewController);
287287
}
288288

289289
private async Task TransitionAsync()
@@ -312,7 +312,7 @@ private async Task TransitionAsync()
312312
tasks[i] = systemControllers[i].TransitionAsync();
313313
}
314314

315-
await Task.WhenAll(tasks).ConfigureAwait(false);
315+
await Task.WhenAll(tasks);
316316
}
317317
_isTransitioning = false;
318318
}

Runtime/PanelSystem/PanelSwapController.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ public async Task TransitionAsync()
3939
//Load Views
4040
if (showController != null)
4141
{
42-
await LoadView(showController).ConfigureAwait(true);
42+
await LoadView(showController);
4343
}
4444

4545
var transitionTask = TransitionDefault(hideController, showController);
46-
await transitionTask.ConfigureAwait(true);
46+
await transitionTask;
4747

4848
activePanelController = showController;
4949
}
@@ -101,12 +101,12 @@ private async Task TransitionDefault(IPanelViewController hideController, IPanel
101101

102102
if (hideTask != null)
103103
{
104-
await hideTask.ConfigureAwait(true);
104+
await hideTask;
105105
}
106106

107107
if (showTask != null)
108108
{
109-
await showTask.ConfigureAwait(true);
109+
await showTask;
110110
}
111111
}
112112

Runtime/PanelSystem/PanelSwapSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void RemoveController(IPanelSystemController controller)
2626

2727
public async void Show(IPanelViewController controller)
2828
{
29-
await ShowAsync(controller).ConfigureAwait(false);
29+
await ShowAsync(controller);
3030
}
3131

3232
public async Task ShowAsync(IPanelViewController panelViewController)

Runtime/PanelSystem/PanelViewControllerBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public async Task ShowAsync(bool immediate = false, ITransitionEvent transitionE
122122

123123
if (!IsViewLoaded)
124124
{
125-
await LoadViewAsync().ConfigureAwait(true);
125+
await LoadViewAsync();
126126

127127
if (currentToken.IsCancellationRequested)
128128
{

Runtime/PanelSystem/PanelViewControllerBehaviour.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,17 @@ public RectTransform ParentTransform
8181

8282
public async void Show(ITransitionEvent transitionEvent = null)
8383
{
84-
await ShowAsync(transitionEvent).ConfigureAwait(false);
84+
await ShowAsync(transitionEvent);
8585
}
8686

8787
public async void Hide(ITransitionEvent transitionEvent = null)
8888
{
89-
await HideAsync(transitionEvent).ConfigureAwait(false);
89+
await HideAsync(transitionEvent);
9090
}
9191

9292
public async void Show(bool immediate, ITransitionEvent transitionEvent = null)
9393
{
94-
await ShowAsync(immediate, transitionEvent).ConfigureAwait(false);
94+
await ShowAsync(immediate, transitionEvent);
9595
}
9696

9797
public Task ShowAsync(bool immediate, ITransitionEvent transitionEvent = null) => BaseController.ShowAsync(immediate, transitionEvent);
@@ -100,7 +100,7 @@ public async void Show(bool immediate, ITransitionEvent transitionEvent = null)
100100

101101
public async void Hide(bool immediate, ITransitionEvent transitionEvent = null)
102102
{
103-
await HideAsync(immediate, transitionEvent).ConfigureAwait(false);
103+
await HideAsync(immediate, transitionEvent);
104104
}
105105

106106
public Task HideAsync(bool immediate, ITransitionEvent transitionEvent = null) => BaseController.HideAsync(immediate, transitionEvent);

Runtime/TransitionSystem/SceneTransitionSystem.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ namespace Gameframe.GUI.TransitionSystem
99
public class SceneTransitionSystem : ScriptableObject
1010
{
1111
private Transition transition = new Transition();
12-
12+
1313
private SingleSceneTransitionTask singleSceneTransitionTask = new SingleSceneTransitionTask();
1414
private MultiSceneTransitionTask multiSceneTransitionTask = new MultiSceneTransitionTask();
15-
15+
1616
private bool isTransitioning;
1717
public bool IsTransitioning => isTransitioning;
1818

@@ -25,7 +25,7 @@ public void RemovePresenter(ITransitionPresenter presenter)
2525
{
2626
transition.RemovePresenter(presenter);
2727
}
28-
28+
2929
private void OnEnable()
3030
{
3131
isTransitioning = false;
@@ -36,19 +36,19 @@ private void OnEnable()
3636

3737
public async void LoadScene(string sceneName, LoadSceneMode mode = LoadSceneMode.Single)
3838
{
39-
await LoadSceneAsync(sceneName, mode).ConfigureAwait(false);
39+
await LoadSceneAsync(sceneName, mode);
4040
}
41-
41+
4242
public async Task LoadSceneAsync(string sceneName, LoadSceneMode mode = LoadSceneMode.Single)
4343
{
4444
if (isTransitioning)
4545
{
4646
throw new InvalidOperationException("Cannot load scenes while scene transition is in progress");
4747
}
48-
48+
4949
singleSceneTransitionTask.Mode = mode;
5050
singleSceneTransitionTask.SceneName = sceneName;
51-
51+
5252
isTransitioning = true;
5353
transition.AddTransitionTask(singleSceneTransitionTask);
5454
await transition.ExecuteAsync();
@@ -58,15 +58,15 @@ public async Task LoadSceneAsync(string sceneName, LoadSceneMode mode = LoadScen
5858

5959
public async void LoadScene(string[] loadScenes, string[] unloadScenes)
6060
{
61-
await LoadScenesAsync(loadScenes, unloadScenes).ConfigureAwait(false);
61+
await LoadScenesAsync(loadScenes, unloadScenes);
6262
}
63-
63+
6464
[Obsolete("Use LoadScenesAsync method instead", false)]
6565
public Task LoadSceneAsync(string[] loadScenes, string[] unloadScenes)
6666
{
6767
return LoadScenesAsync(loadScenes,unloadScenes);
6868
}
69-
69+
7070
/// <summary>
7171
/// Unload and Load multiple scenes
7272
/// </summary>
@@ -80,7 +80,7 @@ public async Task LoadScenesAsync(string[] loadScenes, string[] unloadScenes)
8080
{
8181
throw new InvalidOperationException("Cannot load scenes while scene transition is in progress");
8282
}
83-
83+
8484
isTransitioning = true;
8585
multiSceneTransitionTask.LoadScenes = loadScenes;
8686
multiSceneTransitionTask.UnloadScenes = unloadScenes;
@@ -92,16 +92,16 @@ public async Task LoadScenesAsync(string[] loadScenes, string[] unloadScenes)
9292

9393
public async void LoadScenes(string[] scenesToLoad)
9494
{
95-
await LoadScenesAsync(scenesToLoad).ConfigureAwait(false);
95+
await LoadScenesAsync(scenesToLoad);
9696
}
97-
97+
9898
public async Task LoadScenesAsync(string[] loadScenes)
9999
{
100100
if (isTransitioning)
101101
{
102102
throw new InvalidOperationException("Cannot load scenes while scene transition is in progress");
103103
}
104-
104+
105105
isTransitioning = true;
106106
multiSceneTransitionTask.LoadScenes = loadScenes;
107107
multiSceneTransitionTask.UnloadScenes = new string[0];
@@ -110,6 +110,6 @@ public async Task LoadScenesAsync(string[] loadScenes)
110110
transition.RemoveTransitionTask(multiSceneTransitionTask);
111111
isTransitioning = false;
112112
}
113-
113+
114114
}
115115
}

0 commit comments

Comments
 (0)