Skip to content

Commit

Permalink
Merge pull request #73 from AIO-GAME/1.x
Browse files Browse the repository at this point in the history
1.x
  • Loading branch information
xinansky authored Mar 14, 2024
2 parents 6dc04a0 + 711034f commit 13e4441
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Runtime/Tools/Runner/Runner.Coroutine.Safe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ partial class Runner
private static void SafeStartCoroutine(IEnumerator coroutine)
{
#if UNITY_EDITOR
if (instance == null)
Initialize();
if (IsRuntime)
#endif
instance.StartCoroutine(coroutine);
Expand All @@ -23,6 +25,8 @@ private static void SafeStartCoroutine(IEnumerator coroutine)
private static void SafeStartCoroutine(IList<IEnumerator> coroutines)
{
#if UNITY_EDITOR
if (instance == null)
Initialize();
if (IsRuntime)
#endif
for (var index = 0; index < coroutines.Count; index++)
Expand All @@ -42,6 +46,8 @@ private static void SafeStartCoroutine(IList<IEnumerator> coroutines)
private static void SafeStartCoroutine(IList<Func<IEnumerator>> coroutines)
{
#if UNITY_EDITOR
if (instance == null)
Initialize();
if (IsRuntime)
#endif
for (var index = 0; index < coroutines.Count; index++)
Expand All @@ -61,6 +67,8 @@ private static void SafeStartCoroutine(IList<Func<IEnumerator>> coroutines)
private static void SafeStopCoroutine(IEnumerator coroutine)
{
#if UNITY_EDITOR
if (instance == null)
Initialize();
if (IsRuntime)
#endif
instance.StopCoroutine(coroutine);
Expand All @@ -73,6 +81,8 @@ private static void SafeStopCoroutine(IEnumerator coroutine)
private static void SafeStopCoroutine(IList<IEnumerator> coroutines)
{
#if UNITY_EDITOR
if (instance == null)
Initialize();
if (IsRuntime)
#endif
for (var index = 0; index < coroutines.Count; index++)
Expand All @@ -92,6 +102,8 @@ private static void SafeStopCoroutine(IList<IEnumerator> coroutines)
private static void SafeStopCoroutine(IList<Func<IEnumerator>> coroutines)
{
#if UNITY_EDITOR
if (instance == null)
Initialize();
if (IsRuntime)
#endif
for (var index = 0; index < coroutines.Count; index++)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "com.aio.package",
"displayName": "AIO Unity Common",
"description": "AIO Unity Common",
"version": "1.0.38-preview",
"version": "1.0.39-preview",
"unity": "2019.4",
"category": "Runtime",
"unityRelease": "0f1",
Expand Down

0 comments on commit 13e4441

Please sign in to comment.