Scheduler.FixedUpdate C# (CSharp) Method

FixedUpdate() public method

public FixedUpdate ( ) : void
return void
    public virtual void FixedUpdate()
    {
        if(!begun) { Begin(); }
        if(paused) { return; }
        if(activeCharacter != null && activeCharacter.isActive) { return; }
        if(activeCharacter != null && !activeCharacter.isActive) { Deactivate(activeCharacter); }
    }

Usage Example

Ejemplo 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);
        }