public void HoverSound() { if (updated) { btn.Select(); if (source.isActiveAndEnabled) { source.PlayOneShot(hoverSound); } sB.SaveButton(btn); } updated = false; }
//Plays the sound for the number or outside bet selected public void CountdownFinished() { //Wait until other audio has finished if (audioSource.isPlaying || nums.isPlaying) { Debug.Log(audioSource.isPlaying); StartCoroutine(StartCountdown(0.1f)); } else { btn = EventSystem.current.currentSelectedGameObject.GetComponent<Button>(); audioSource.pitch = 1f; audioSource.panStereo = 0f; string temp = btn.name; //Plays a number if (inside && audioSource.isActiveAndEnabled) { num = btn.GetComponentInChildren<TMP_Text>().text; int i = int.Parse(num); nRS.SetNumber(i); nRS.ReadNumber(); } //Plays an outside bet name else if (audioSource.isActiveAndEnabled) { int count = 0; switch (temp) { case "1st_Column": count = 7; break; case "2nd_Column": count = 8; break; case "3rd_Column": count = 9; break; case "1st_Third": count = 0; break; case "2nd_Third": count = 1; break; case "3rd_Third": count = 2; break; case "Evens": count = 3; break; case "Odds": count = 4; break; case "Blacks": count = 5; break; case "Reds": count = 6; break; case "1_To_18": count = 10; break; case "19_To_36": count = 11; break; default: Debug.Log("naming error"); break; } audioSource.PlayOneShot(outside[count]); } //Saves the button to be accessed on double tap sB.SaveButton(btn); } }