/// <summary> /// plays 'sound' on the auto-created, second audio source /// </summary> void DoPlaySound(AudioClip sound) { if (sound == null) { return; } Audio2.pitch = vp_TimeUtility.AdjustedTimeScale; Audio2.clip = sound; Audio2.Stop(); Audio2.Play(); }
// Pause music for sfx private IEnumerator CombinationSFX() { yield return(null); Audio.Pause(); Audio2.Stop(); //Insert burp sfx selection here Audio2.PlayOneShot(SFX[21]); yield return(new WaitForSeconds(1f)); CameraAnimator.SetBool("ScreenShake", true); Audio2.PlayOneShot(SFX[20]); yield return(new WaitForSeconds(2f)); CameraAnimator.SetBool("ScreenShake", false); Audio.UnPause(); }
//public GameObject GameManager; // Start is called before the first frame update void Start() { Audio2.Stop(); timeUP = false; RanMsg.SetActive(false); BossHP_txt.SetActive(false); setWorldStr(); SetupWorld(); gameHandler = GameObject.FindWithTag("GameController"); enemyHandler = GameObject.FindWithTag("EnemyHandler"); player = GameObject.FindWithTag("Player"); gameMode = gameHandler.GetComponent <ModeSelection>().getMode(); if (gameMode == 2) { topTextDisplay[1].text = "Inverse"; TimerBG.SetActive(false); Button btn = Ans1.GetComponent <Button>(); btn.onClick.AddListener(SelectedAns1Inverse); Button btn2 = Ans2.GetComponent <Button>(); btn2.onClick.AddListener(SelectedAns2Inverse); Button btn3 = Ans3.GetComponent <Button>(); btn3.onClick.AddListener(SelectedAns3Inverse); Button btn4 = Ans4.GetComponent <Button>(); btn4.onClick.AddListener(SelectedAns4Inverse); Button cfmbtn1 = cfmbtn.GetComponent <Button>(); cfmbtn1.onClick.AddListener(confirmAnsInverse); } else if (gameMode == 1) { topTextDisplay[1].text = "Time Attack"; Button btn = Ans1.GetComponent <Button>(); btn.onClick.AddListener(SelectedAns1); Button btn2 = Ans2.GetComponent <Button>(); btn2.onClick.AddListener(SelectedAns2); Button btn3 = Ans3.GetComponent <Button>(); btn3.onClick.AddListener(SelectedAns3); Button btn4 = Ans4.GetComponent <Button>(); btn4.onClick.AddListener(SelectedAns4); Button cfmbtn1 = cfmbtn.GetComponent <Button>(); cfmbtn1.onClick.AddListener(confirmAns); Button skill_btn1 = skill_btn.GetComponent <Button>(); skill_btn1.onClick.AddListener(skill); } else { topTextDisplay[1].text = "Normal"; TimerBG.SetActive(false); Button btn = Ans1.GetComponent <Button>(); btn.onClick.AddListener(SelectedAns1); Button btn2 = Ans2.GetComponent <Button>(); btn2.onClick.AddListener(SelectedAns2); Button btn3 = Ans3.GetComponent <Button>(); btn3.onClick.AddListener(SelectedAns3); Button btn4 = Ans4.GetComponent <Button>(); btn4.onClick.AddListener(SelectedAns4); Button cfmbtn1 = cfmbtn.GetComponent <Button>(); cfmbtn1.onClick.AddListener(confirmAns); Button skill_btn1 = skill_btn.GetComponent <Button>(); skill_btn1.onClick.AddListener(skill); } Alert.SetActive(false); Clear_Msg.SetActive(false); GameOver_MSG.SetActive(false); }