private void changeSpeed() { if (MainMain.isDownTempoPhase()) { speed_x_z = MainMain.calcDownTempo(); } else { if (speed_x_z_accelerate) { speed_x_z = speedAcceleratorFactor * speed_x_z; if (speed_x_z > maxSpeed_x_z) { speed_x_z_accelerate = false; } } else { speed_x_z = speed_x_z / speedAcceleratorFactor; if (speed_x_z <= initialSpeed_x_z) { speed_x_z_accelerate = true; } } } }
private void moveBody(Vector3 v) { float speed_x_z; if (MainMain.isDownTempoPhase()) { speed_x_z = MainMain.calcDownTempo(); } else { speed_x_z = getRandomizedSpeed(); } head.transform.Translate(speed_x_z * v * Time.deltaTime); body.transform.Translate(speed_x_z * v * Time.deltaTime); }