| | 1 | | namespace DCL.Components |
| | 2 | | { |
| | 3 | | /// <summary> |
| | 4 | | /// Unity is unable to yield a coroutine while is already being yielded by another one. |
| | 5 | | /// To fix that we wrap the routine in a CustomYieldInstruction. |
| | 6 | | /// </summary> |
| | 7 | | public class WaitForComponentUpdate : CleanableYieldInstruction |
| | 8 | | { |
| | 9 | | public IDelayedComponent component; |
| | 10 | |
|
| 0 | 11 | | public WaitForComponentUpdate(IDelayedComponent component) { this.component = component; } |
| | 12 | |
|
| 0 | 13 | | public override bool keepWaiting { get { return component.isRoutineRunning; } } |
| | 14 | |
|
| 0 | 15 | | public override void Cleanup() { component.Cleanup(); } |
| | 16 | | } |
| | 17 | | } |