//updates every frame (do not insert callbacks without conditions, caused the will be called every frame and will decrease perfromance). void Update() { //checks if game is paused or not if (gameManager.gamePaused == true) { PauseTurbine(gameManager.gamePaused); } else { if (scriptsEnabled == false) { UnPauseTurbine(gameManager.gamePaused); } //sets the speed of the rotation based on the wind rotation turbineAnim.SetRotationSpeed(simulator.currentWindSpeed); //used for disables rotation when wind is low if (simulator.currentWindSpeed < 3 && IsRotating() == true) { DisableOnWindLow(); } if (simulator.currentWindSpeed > 3 && IsRotating() == false && lowWindDisabled == true) { EnableOnWindHigh(); } } }
void Update() { //checks if game is paused or not if (gameManager.gamePaused == true) { PauseTurbine(gameManager.gamePaused); } else { if (scriptsEnabled == false) { UnPauseTurbine(gameManager.gamePaused); } //sets the speed of the rotation based on the wind rotation turbineAnim.SetRotationSpeed(simulator.currentWindSpeed); } }