-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use CoroutineUtils.Try in the WrappedRequest method
- Loading branch information
Showing
5 changed files
with
32 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections; | ||
using UnityEngine; | ||
|
||
/// <summary> | ||
/// Helper class that will allow to run a coroutine | ||
/// </summary> | ||
public class CoroutineRunner : MonoBehaviour | ||
{ | ||
private static CoroutineRunner _instance; | ||
|
||
public static CoroutineRunner Instance | ||
{ | ||
get | ||
{ | ||
if (_instance == null) | ||
_instance = (new GameObject("CoroutineRunner")).AddComponent<CoroutineRunner>(); | ||
|
||
return _instance; | ||
} | ||
} | ||
|
||
private void Awake() | ||
{ | ||
DontDestroyOnLoad(gameObject); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
.../Scripts/Helpers/CoroutineWrapper.cs.meta → ...e/Scripts/Helpers/CoroutineRunner.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,5 @@ public static IEnumerator Try( | |
} | ||
yield return current; | ||
} | ||
exceptionHandler?.Invoke(null); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters