示例#1
0
    private void Update()
    {
        BlackBoard.GameStarted();

        if (this.playBack != PlayBack.None)
        {
            this.DispatchFrom(this.playBackPublishers);
            Dispatcher.deltaTime = Time.deltaTime;
        }

        if (!isThreading)
        {
            if (Dispatcher.instance.threadedPublishers != null && Dispatcher.instance.threadedPublishers.Count > 0)
            {
                isThreading      = true;
                dispatcherThread = new Thread(new ThreadStart(Dispatcher.DispatchThreaded));
                dispatcherThread.Start();
                while (!dispatcherThread.IsAlive)
                {
                    ;
                }
                Thread.Sleep(1);
            }
        }

        if (this.playBack == PlayBack.None)
        {
            Dispatcher.deltaTime = Time.deltaTime;
            BlackBoard.Commit();

            Dispatcher.DispatchThreaded();

            foreach (Publisher publisher in Dispatcher.Dispatch())
            {
            }
        }
    }