// for solid objects the fish hits, eg. a car void OnCollisionEnter(Collision collision) { if (!fishOxygen.fishInWater()) { GetComponent <FishSound>().playFishSound(); } if (collision.gameObject.tag == "Obstacle") { fishMovement.isGrounded = false; StartCoroutine(Respawn(false)); } }
bool isFishSafe() { return(fishOxygen.fishInWater()); }