Esempio n. 1
0
    private void speedModificator(float modifier)
    {
        float newSpeed = speed;

        newSpeed -= ((newSpeed * modifier) / 100);
        if (newSpeed > minSpeed)
        {
            snakeMovement.setSpeed(minSpeed);
            speed = minSpeed;
        }
        else
        {
            snakeMovement.setSpeed(newSpeed);
            speed = newSpeed;
        }

        //Debug.Log (speed);
    }