private void InitMusic() { audioSource = GetComponent <AudioSource>(); var music = GamerPrefs.GetMusicOn(); // 悪い willPlay = (music == 1) ? true : false; }
public void HandleSound() { if (optionsPanelVisible) { optionsPanelVisible = false; optionsPanel.SetActive(false); } int music = GamerPrefs.GetMusicOn(); if (music == 1) { music = 0; GamerPrefs.SetMusicOn(0); } else { music = 1; GamerPrefs.SetMusicOn(1); } Text soundText = soundButton.GetComponent <Text>(); soundText.text = (music == 1) ? "Sound On" : "Sound Off"; willPlay = (music == 1) ? true : false; HandleMainMenuBgMusic(); }
private void HandleMusicButtonText() { var music = GamerPrefs.GetMusicOn(); soundText = soundButton.GetComponent <Text>(); soundText.text = (music == 1) ? "Sound On" : "Sound Off"; willPlay = (music == 1) ? true : false; HandleMainMenuBgMusic(); }
// Use this for initialization void Start() { speed = -1 * Mathf.Sqrt(speed * speed); // using square root incase speed is negative audioSource = GetComponent <AudioSource>(); int music = GamerPrefs.GetMusicOn(); // 悪い willPlay = (music == 1) ? true : false; dangos = -1; InitShieldFunc(); }
private void HandleMusicButtonText() { // 音楽 int music = GamerPrefs.GetMusicOn(); // 悪い soundText = GameObject.Find("Sound Button").GetComponent <Text>(); soundText.text = (music == 1) ? "Sound On" : "Sound Off"; willPlay = (music == 1) ? true : false; HandleMainMenuBGMusic(); }
// UI Update ///////////////////////////////// // Game Play ///////////////////////////////// public void HandleGlassSound() { if (GamerPrefs.GetMusicOn() == 1) { willPlayMusic = true; } else { willPlayMusic = false; } }
public void PlayBackgroundMusic(AudioClip clip) { var willPlay = GamerPrefs.GetMusicOn() == 1 ? true : false; if (!willPlay || bgAudioSource.isPlaying) { return; } bgAudioSource.clip = clip; bgAudioSource.Play(); }
public void PlaySfx(AudioClip clip) { StopSfx(); var willPlay = GamerPrefs.GetMusicOn() == 1 ? true : false; if (!willPlay) { return; } sfxAudioSource.clip = clip; sfxAudioSource.Play(); }
public void ForcePlayBackgroundMusic(AudioClip clip) { StopBackgroundMusic(); var willPlay = GamerPrefs.GetMusicOn() == 1 ? true : false; if (!willPlay) { return; } bgAudioSource.clip = clip; bgAudioSource.Play(); }
public void HandleGameBGMusic() { _audioSource = GetComponent <AudioSource>(); _audioSource.loop = true; if (GamerPrefs.GetMusicOn() == 1) { willPlayMusic = true; } else { willPlayMusic = false; } HandleBGMusicStart(); }
public void HandleSound() { int music = GamerPrefs.GetMusicOn(); if (music == 1) { music = 0; GamerPrefs.SetMusicOn(0); } else { music = 1; GamerPrefs.SetMusicOn(1); } Text soundText = GameObject.Find("Sound Button").GetComponent <Text>(); soundText.text = (music == 1) ? "Sound On" : "Sound Off"; willPlay = (music == 1) ? true : false; HandleMainMenuBGMusic(); }
public void HandleMarketSceneBgMusic() { var music = GamerPrefs.GetMusicOn(); // 悪い willPlay = (music == 1) ? true : false; var audioSource = GetComponent <AudioSource>(); if (willPlay) { if (!audioSource.isPlaying) { audioSource.Play(); } } else { if (audioSource.isPlaying) { audioSource.Stop(); } } }
public void HandleHighSoreSceneBGMusic() { int music = GamerPrefs.GetMusicOn(); // 悪い willPlay = (music == 1) ? true : false; AudioSource audioSource = GetComponent <AudioSource>(); if (willPlay) { if (!audioSource.isPlaying) { audioSource.Play(); } } else { if (audioSource.isPlaying) { audioSource.Stop(); } } }
// Use this for initialization void Start() { // 音楽 int music = GamerPrefs.GetMusicOn(); // 悪い willPlay = (music == 1) ? true : false; AudioSource audioSource = GetComponent <AudioSource>(); if (willPlay) { if (!audioSource.isPlaying) { audioSource.Play(); } } else { if (audioSource.isPlaying) { audioSource.Stop(); } } }