/* Queue a command to be executed on update on the main thread */ public static void Queue(CommandAttribute command, string[] args) { QueuedCommand queuedCommand = new QueuedCommand(); queuedCommand.command = command; queuedCommand.args = args; Instance.m_commandQueue.Enqueue(queuedCommand); }
public static void Update() { while (Instance.m_commandQueue.Count > 0) { QueuedCommand cmd = Instance.m_commandQueue.Dequeue(); cmd.command.m_callback(cmd.args); } }
public static void Update() { while (Instance.m_commandQueue.Count > 0) { QueuedCommand cmd = Instance.m_commandQueue.Dequeue(); if (cmd.command == null || cmd.command.m_callback == null) { continue; } cmd.command.m_callback(cmd.args); } }
/* Queue a command to be executed on update on the main thread */ public static void Queue(CommandAttribute command, string[] args) { QueuedCommand queuedCommand = new QueuedCommand(); queuedCommand.command = command; queuedCommand.args = args; Instance.m_commandQueue.Enqueue( queuedCommand ); }