/**************************************************************************** * Copyright 2019 Nreal Techonology Limited. All rights reserved. * * This file is part of NRSDK. * * https://www.nreal.ai/ * *****************************************************************************/ namespace NRKernal { using UnityEngine; /// /// A yield instruction that blocks a coroutine until an AsyncTask has completed. /// The type of the AsyncTask result. public class WaitForTaskCompletionYieldInstruction : CustomYieldInstruction { /// The AsyncTask the yield instruction waits on. private AsyncTask m_Task; /// Constructor for WaitForTaskCompletionYieldInstruction. /// The task to wait for completion. public WaitForTaskCompletionYieldInstruction(AsyncTask task) { m_Task = task; } /// /// Gets a value indicating whether the coroutine instruction should keep waiting. /// true if the task is incomplete, otherwise false. public override bool keepWaiting { get { return !m_Task.IsComplete; } } } }