private IEnumerator Routine(OptionSelect_2 optionBtn) { if (audioSource.isPlaying) { audioSource.Stop(); } audioSource.clip = optionBtn.option.correct ? correctSound : incorrectSound; optionBtn.SetColor(optionBtn.option.correct ? correctColor : incorrectColor); audioSource.Play(); yield return(new WaitForSeconds(waitTime)); NextQuestion(); }
private void GiveAnswer(OptionSelect_2 optionBtn) { StartCoroutine(Routine(optionBtn)); }