public void HardOn() { if (Hardbass.isPlaying == false) { Hardbass.Play(); Music1.Stop(); Music2.Stop(); } }
// Update is called once per frame IEnumerator Roll() { Music1.Play(); yield return(new WaitForSeconds(325f)); Music2.Play(); yield return(new WaitForSeconds(230f)); StartCoroutine(Roll()); }
static void Main() { Song s = new Song(); s.BaseInfo(); Music2 m2 = new Music2(); m2.BaseInfo(); Music m = new Music(); m.BaseInfo(); }
void Awake() { audioSrc = GetComponent <AudioSource>(); if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
private void Awake() { audioSource = GetComponent <AudioSource>(); // - //- GameObject[] objs = GameObject.FindGameObjectsWithTag("music"); // if (objs.Length > 1) // { // Destroy(this.gameObject); // } // DontDestroyOnLoad(this.gameObject); instance = this; }
private void Awake() { menu = GameObject.Find("OptionsPopup"); multiplayer = GameObject.FindGameObjectWithTag("multiplayer"); tutorial = GameObject.FindGameObjectWithTag("tutorial"); options = GameObject.FindGameObjectWithTag("options"); singlePlayer = GameObject.FindGameObjectWithTag("singleplayer"); help = GameObject.FindGameObjectWithTag("help"); exit = GameObject.FindGameObjectWithTag("exit"); mute = GameObject.Find("mute"); unmute = GameObject.Find("unmute"); switchRight = GameObject.Find("switchRight"); switchLeft = GameObject.Find("switchLeft"); effectsSwitch = GameObject.Find("switch"); offSwitch = GameObject.Find("offSwitch"); onSwitch = GameObject.Find("onSwitch"); music = Music.getInstance(); music2 = Music2.getInstance(); if (Music.playSoundEffects) { offSwitch.GetComponent <Renderer> ().enabled = false; onSwitch.GetComponent <Renderer> ().enabled = true; effectsSwitch.transform.position = switchRight.transform.position; isMute = false; } else { offSwitch.GetComponent <Renderer> ().enabled = true; onSwitch.GetComponent <Renderer> ().enabled = false; effectsSwitch.transform.position = switchLeft.transform.position; isMute = true; } }
private void Awake() { audioSource = GetComponent <AudioSource>(); musicSwitchRight = GameObject.Find("musicSwitchRight"); musicSwitchLeft = GameObject.Find("musicSwitchLeft"); switchMusic = GameObject.Find("switchMusic"); onSwitchMusic = GameObject.Find("onSwitchMusic"); offSwitchMusic = GameObject.Find("offSwitchMusic"); hintsSwitchRight = GameObject.Find("hintsSwitchRight"); hintsSwitchLeft = GameObject.Find("hintsSwitchLeft"); switchHints = GameObject.Find("switchHints"); onSwitchHints = GameObject.Find("onSwitchHints"); offSwitchHints = GameObject.Find("offSwitchHints"); onSwitchHints.GetComponent <Renderer> ().enabled = true; offSwitchHints.GetComponent <Renderer> ().enabled = false; switchHints.transform.position = hintsSwitchRight.transform.position; Music2 musicInstance = Music2.getInstance(); if (OptionsPopup.isMute) { onSwitchMusic.GetComponent <Renderer> ().enabled = false; offSwitchMusic.GetComponent <Renderer> ().enabled = true; switchMusic.transform.position = musicSwitchLeft.transform.position; //audioSource.volume = 0f; } else { onSwitchMusic.GetComponent <Renderer> ().enabled = true; offSwitchMusic.GetComponent <Renderer> ().enabled = false; switchMusic.transform.position = musicSwitchRight.transform.position; } }
void Stop() { Music.Stop(); Music2.Stop(); }
void Play2() { Music2.Play(); }