/** * Disables charging and releasing jumps for the respawn duration. * Respawns the fish after the duration has passed. */ public IEnumerator Respawn(bool instant) { if (!respawning && !wonLevel) { respawning = true; fishMovement.inControl = false; fishIndicators.StopIndicators(); if (!instant) { yield return(new WaitForSeconds(respawnTime)); } rb.velocity = new Vector3(0.0f, 0.0f, 0.0f); transform.rotation = fishMovement.respawnRotation; transform.position = fishMovement.respawnPosition; fishMovement.ResetSliderAndFish(); fishMovement.inControl = true; fishMovement.isGrounded = false; fishOxygen.SetOxygen(fishOxygen.OXYGEN_MAX); fishOxygen.timeLastInWater = Time.time; respawning = false; } }
public void ResetSliderAndFish() { powerBar.StopCharge(); fishIndicators.StopIndicators(); }