Skip to content

Commit 4161b60

Browse files
authored
Merge pull request #22 from coryleach/dev
ConfigureAwait changes to fix compatibility issues with WebGL
2 parents febbc36 + b4af9ac commit 4161b60

16 files changed

+83
-79
lines changed

Demo/Demo.unitypackage

-103 Bytes
Binary file not shown.

README.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
<p align="center">
2+
<img align="center" src="https://raw.githubusercontent.com/coryleach/UnityPackages/master/Documentation/GameframeFace.gif" />
3+
</p>
14
<h1 align="center">Gameframe.GUI 👋</h1>
5+
6+
<!-- BADGE-START -->
27
<p>
3-
<img alt="Version" src="https://img.shields.io/badge/version-3.0.5-blue.svg?cacheSeconds=2592000" />
8+
<img alt="Version" src="https://img.shields.io/badge/version-3.0.6-blue.svg?cacheSeconds=2592000" />
49
<a href="https://twitter.com/Cory Leach">
510
<img alt="Twitter: coryleach" src="https://img.shields.io/twitter/follow/coryleach.svg?style=social" target="_blank" />
611
</a>
7-
</p>
12+
</p>
13+
<!-- BADGE-END -->
814

915
This is a library of GUI helpers for UGUI
1016
Includes a panel system that implements a navigation stack.
@@ -16,15 +22,15 @@ Includes a SRP shader for blurring the background of UI panels.
1622
#### Using UnityPackageManager (for Unity 2019.3 or later)
1723
Open the package manager window (menu: Window > Package Manager)<br/>
1824
Select "Add package from git URL...", fill in the pop-up with the following link:<br/>
19-
https://github.com/coryleach/UnityGUI.git#3.0.5<br/>
25+
https://github.com/coryleach/UnityGUI.git#3.0.6<br/>
2026

2127
#### Using UnityPackageManager (for Unity 2019.1 or later)
2228

2329
Find the manifest.json file in the Packages folder of your project and edit it to look like this:
2430
```js
2531
{
2632
"dependencies": {
27-
"com.gameframe.gui": "https://github.com/coryleach/UnityGUI.git#3.0.5",
33+
"com.gameframe.gui": "https://github.com/coryleach/UnityGUI.git#3.0.6",
2834
...
2935
},
3036
}
@@ -78,8 +84,8 @@ Contains information about a panel and is used by the PanelViewController to loc
7884

7985

8086
## Show your support
81-
8287
Give a ⭐️ if this project helped you!
8388

89+
8490
***
8591
_This README was generated with ❤️ by [Gameframe.Packages](https://github.com/coryleach/unitypackages)_

Runtime/PanelSystem/PanelStackController.cs

+2-2
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

+21-21
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

+4-4
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

+1-1
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

+1-1
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

+4-4
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);

0 commit comments

Comments
 (0)