Exemplo n.º 1
0
    void UpdateStatus(int i, float sqrSpeed, float deltaTime)
    {
        // Check if a transition should happen
        int current = crowdMgr.AnimationStatusCPU[i].dstID;
        int next    = stateDefinition[current].nextState(sqrSpeed);

        // Update animation play speed if needed
        if (stateDefinition[current].speed != null)
        {
            crowdMgr.SetPlaySpeed(i, stateDefinition[current].speed(sqrSpeed));
        }

        // Begin a transition
        if (next != current)
        {
            float playSpeed = 1.0f;
            if (stateDefinition[next].speed != null)
            {
                playSpeed = stateDefinition[next].speed(sqrSpeed);
            }
            crowdMgr.BeginAnimTransition(i, playSpeed, next);
        }
    }