File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
Runtime/Async/Coroutine/Pooled YieldInstruction Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1+ #if UNITY_2020_1_OR_NEWER
12using UnityEngine ;
23
34namespace StansAssets . Foundation . Async
@@ -34,3 +35,4 @@ public WaitForSecondsPooled Wait(float time)
3435 }
3536 }
3637}
38+ #endif
Original file line number Diff line number Diff line change 1+ #if UNITY_2020_1_OR_NEWER
12using UnityEngine ;
23
34namespace StansAssets . Foundation . Async
@@ -34,3 +35,4 @@ public WaitForSecondsRealtimePooled Wait(float time)
3435 }
3536 }
3637}
38+ #endif
Original file line number Diff line number Diff line change @@ -12,10 +12,13 @@ public static class YieldPool
1212 static YieldPool ( )
1313 {
1414 s_Instructions = new Dictionary < Type , ObjectPool < PooledYieldInstruction > > ( ) ;
15- Add < WaitForSecondsPooled > ( ) ;
15+
1616 Add < WaitUntilPooled > ( ) ;
1717 Add < WaitWhilePooled > ( ) ;
18+ #if UNITY_2020_1_OR_NEWER
19+ Add < WaitForSecondsPooled > ( ) ;
1820 Add < WaitForSecondsRealtimePooled > ( ) ;
21+ #endif
1922 }
2023
2124 static void Add < T > ( ) where T : PooledYieldInstruction , new ( )
@@ -34,6 +37,7 @@ internal static void BackToPool<T>(T pooled) where T : PooledYieldInstruction
3437 return ( T ) s_Instructions [ typeof ( T ) ] . Get ( ) ;
3538 }
3639
40+ #if UNITY_2020_1_OR_NEWER
3741 /// <summary>
3842 /// Wait for a given number of seconds using scaled time.
3943 /// <param name="seconds">Delay execution by the amount of time in seconds.</param>
@@ -51,6 +55,7 @@ public static WaitForSecondsRealtimePooled WaitForSecondsRealtime(float seconds)
5155 {
5256 return GetFromPool < WaitForSecondsRealtimePooled > ( ) . Wait ( seconds ) ;
5357 }
58+ #endif
5459
5560 /// <summary>
5661 /// Suspends the coroutine execution until the supplied delegate evaluates to false.
You can’t perform that action at this time.
0 commit comments