Skip to content

Instantly share code, notes, and snippets.

@gmodecorp
Created December 22, 2014 13:07
Show Gist options
  • Save gmodecorp/49d16ae037848fc766d0 to your computer and use it in GitHub Desktop.
Save gmodecorp/49d16ae037848fc766d0 to your computer and use it in GitHub Desktop.
public void Update()
{
// すべてのMonoBehaviourを実行
foreach (MyLib.BehaviourData bdata in behaviourDict.Values)
{
if (!bdata.mainloopBegan)
{
bdata.behaviour.Start();
bdata.mainloopBegan = true;
}
bdata.behaviour.Update();
}
foreach (MyLib.BehaviourData bdata in behaviourDict.Values)
{
LinkedListNode<MyLib.Coroutine> node = bdata.routineList.First;
while (node != null)
{
MyLib.Coroutine coroutine = node.Value;
if (!coroutine.routine.MoveNext())
{
var currentNode = node;
node = node.Next;
bdata.routineList.Remove(currentNode);
}
else
{
node = node.Next;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment