FixedUpdate() public method

public FixedUpdate ( ) : void
return void
Exemplo n.º 1
0
        public void TasksGetCalledOnFixedUpdate()
        {
            int calls = 0;

            mTestScheduler.StartCoroutine(MockCoroutine(mMockFixedYieldInstruction, delegate()
            {
                calls++;
            }));

            mMockFixedYieldInstruction.Step();
            mTestScheduler.FixedUpdate();
            Assert.AreEqual(1, calls);

            calls = 0;
            int iterations = 20;

            for (int i = 0; i < iterations; ++i)
            {
                mMockFixedYieldInstruction.Step();
                mTestScheduler.FixedUpdate();
            }
            Assert.AreEqual(iterations, calls);
        }