void FixedUpdate() { if (Game4Global.GetGameState() != GameState.GS_PLAY) { return; } //calculate roadSpeed roadSpeed = TurtleCharacter.currentSpeed; roadPosition += roadSpeed / 60.0f; while (roadPosition > roadHeight / 100.0f) { roadPosition -= roadHeight / 100.0f; } roadVector.y = -roadPosition; }
// Update is called once per frame void FixedUpdate() { if (Game4Global.GetGameState() != GameState.GS_PLAY) { return; } //add Velocity if (!IsStruggle) { currentSpeed += maxSpeed / 100.0f; if (!IsBoost) { if (currentSpeed > maxSpeed) { currentSpeed = maxSpeed; } } else { currentSpeed = maxSpeed + Game4Global.pGlobal.BoosterSpeedPlus; } } }