mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-11 13:04:17 -05:00
31 lines
790 B
C#
31 lines
790 B
C#
namespace UniTask
|
|
{
|
|
public class StepScheduler : IScheduler
|
|
{
|
|
LockQueue<TaskChain> m_taskQueue = new LockQueue<TaskChain>();
|
|
public void Enqueue(TaskChain item)
|
|
{
|
|
m_taskQueue.Enqueue(item);
|
|
}
|
|
|
|
TaskChain m_chain;
|
|
public int UpdateAndGetTaskCount()
|
|
{
|
|
if (m_chain != null)
|
|
{
|
|
var status=m_chain.Next();
|
|
if(status==ExecutionStatus.Continue)
|
|
{
|
|
// m_item継続中
|
|
return m_taskQueue.Count;
|
|
}
|
|
m_chain = null;
|
|
}
|
|
|
|
int count;
|
|
m_chain = m_taskQueue.Dequeue(out count);
|
|
return count;
|
|
}
|
|
}
|
|
}
|