Example #1
0
        /* 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);
        }
Example #2
0
 public static void Update()
 {
     while (Instance.m_commandQueue.Count > 0)
     {
         QueuedCommand cmd = Instance.m_commandQueue.Dequeue();
         cmd.command.m_callback(cmd.args);
     }
 }
Example #3
0
 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);
     }
 }
Example #4
0
 /* 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 );
 }