コード例 #1
0
ファイル: BBMacroRecorder.cs プロジェクト: SylarLi/BBTester
 public void Update(float deltaTime)
 {
     if (!mIsPaused)
     {
         mEmulator.Update(deltaTime);
     }
 }
コード例 #2
0
ファイル: BBMacroCapture.cs プロジェクト: SylarLi/BBTester
    public void Update(float deltaTime)
    {
        mEmulator.Update(deltaTime);
        BBInputSnapshot current = mEmulator.recordHead;

        while (current != null)
        {
            if (current.type == BBInputType.Release ||
                current.type == BBInputType.KeyUp)
            {
                mCaptureResult = StopCapture();
                break;
            }
            current = current.next;
        }
    }
コード例 #3
0
 public void Update(float deltaTime)
 {
     if (mIsPlaying && !mIsPaused)
     {
         if (mInterrupts.Count > 0)
         {
             for (int i = mInterrupts.Count - 1; i >= 0; i--)
             {
                 if (!mInterrupts[i].isPlaying)
                 {
                     mInterrupts[i].Dispose();
                     mInterrupts.RemoveAt(i);
                 }
                 else
                 {
                     mInterrupts[i].Update(deltaTime);
                 }
             }
         }
         else if (mSeriesQueue.Count > 0)
         {
             BBMacroPlayer player = mSeriesQueue.Dequeue();
             player.Play();
             mInterrupts.Add(player);
         }
         else if (mCurrent == null)
         {
             mIsPlaying = false;
         }
         else
         {
             if (mCurrentTime > 0)
             {
                 mCurrentTime -= deltaTime;
             }
             else
             {
                 mCurrentDelay -= deltaTime;
             }
             if (mEmulator.isPlaying)
             {
                 mEmulator.Update(deltaTime);
             }
             else
             {
                 while ((mCurrentDelay < 0 || mCurrentTime < 0) &&
                        !mEmulator.isPlaying && mInterrupts.Count == 0)
                 {
                     if (mCurrentTime < 0)
                     {
                         if (mCurrentTimes < mCurrent.times)
                         {
                             mCurrentTimes += 1;
                         }
                         else
                         {
                             mCurrent = mCurrent.next;
                             if (mCurrent == null)
                             {
                                 break;
                             }
                         }
                         mCurrent.RunScript();
                         mCurrentDelay += mCurrent.delay;
                         mCurrentDelay += mCurrentTime;
                         mCurrentTime   = 0;
                     }
                     if (mCurrentDelay < 0)
                     {
                         BBLoopAction action = BBLoopAction.Continue;
                         Execute(mCurrent, out action);
                         if (action == BBLoopAction.Continue)
                         {
                             mCurrentTime += mCurrent.duration;
                             mCurrentTime += mCurrentDelay;
                         }
                         else if (action == BBLoopAction.Break)
                         {
                             mCurrentTimes = mCurrent.times;
                             mCurrentTime  = -float.Epsilon;
                         }
                         mCurrentDelay = 0;
                     }
                 }
             }
         }
     }
 }