public IEnumerator ApplySanity(Bed bed) { while (IsAttacking && !Game.Controller.isGameOver && !_stop) { bed.ReduceSanity(damage); if (!AudioSource.isPlaying && attackSound.Length != 0) { AudioSource.PlayOneShot(attackSound[Random.Range(0, attackSound.Length)]); } yield return(new WaitForSeconds(attackTime)); } }