// Use this for initialization void Start() { moduleId = moduleIdCounter++; ignoreList = bossModule.GetIgnoredModules(modSelf, ignoreList); modSelf.OnActivate += StartBossModule; for (int x = 0; x < arrowRenderers.Length; x++) { arrowRenderers[x].material.color = Color.black; } textDisplay.text = ""; firstTextColor = textDisplay.color; for (int x = 0; x < arrowButtons.Length; x++) { int y = x; arrowButtons[x].OnInteract += delegate { if (!(moduleSolved || isanimating)) { MAudio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, arrowButtons[y].transform); arrowButtons[y].AddInteractionPunch(); ProcessInput(y); } return(false); }; } }
// Use this for initialization void Start() { if (GameObject.FindGameObjectsWithTag("AudioManager").Length > 1) { Destroy(this.gameObject); return; } DontDestroyOnLoad(this.gameObject); if (!PlayerPrefs.HasKey("BGM_VOL") || !PlayerPrefs.HasKey("FX_VOL")) { BGMSource.volume = 1f; FXSource.volume = 1f; } else { BGMSource.volume = PlayerPrefs.GetFloat("BGM_VOL"); FXSource.volume = PlayerPrefs.GetFloat("FX_VOL"); } if (PlayerPrefs.GetInt("BGM_MUTE") == 1) { BGMSource.mute = true; } if (PlayerPrefs.GetInt("FX_MUTE") == 1) { FXSource.mute = true; } instance = this; PlayBGM(AudioDatabase.Instance.getBGMAudio("mainmenu")); }
// Use this for initialization void Start() { moduleId = moduleIdCounter++; modSelf.OnActivate += delegate { StopAllCoroutines(); colorblindArrowDisplay.gameObject.SetActive(colorblindActive); GenerateAnswer(); }; textDisplay.text = ""; mBombInfo.OnBombExploded += delegate { StopAllCoroutines(); }; for (var x = 0; x < colorblindArrowRenderMesh.Length; x++) { colorblindArrowRenderMesh[x].text = ""; } for (var x = 0; x < arrowButtons.Length; x++) { int y = x; arrowButtons[x].OnInteract += delegate { if (!(isanimating || moduleSolved)) { arrowButtons[y].AddInteractionPunch(); MAudio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, arrowButtons[y].transform); ProcessInput(y); } return(false); }; } StartCoroutine(MakeArrowsCycleRainbow()); }
private IEnumerator PlayAllAmbientAudio(MAudio mAudio, bool loop) { var audio = PlayAmbientAudio(mAudio, loop, true); var time = audio.AudioSource.clip.length; yield return(new WaitForSeconds(time)); StartCoroutine(PlayAllAmbientAudio(mAudio, loop)); }
private void PlaySoundAudio(MAudio mAudio, bool loop) { _soundId = EazySoundManager.PrepareMusic( mAudio.AudioClip, 0.2f, loop, false ); Audio audio = EazySoundManager.GetAudio(_soundId.Value); audio.Play(); }
private Audio PlayAmbientAudio(MAudio mAudio, bool loop, bool loadMany = false) { ClearAmbientQueue(); _ambientMusicId = EazySoundManager.PrepareMusic( loadMany ? mAudio.AudioClips[mAudio.GetRandomIndex()] : mAudio.AudioClip, 0.2f, loop, false ); Audio audio = EazySoundManager.GetAudio(_ambientMusicId.Value); audio.Play(); return(audio); }
void Awake() { moduleId = moduleIdCounter++; moduleSolved = false; colorblindActive = Colorblind.ColorblindModeActive; for (int x = 0; x < arrowButtons.Length; x++) { int y = x; arrowButtons[x].OnInteract += delegate() { if (!moduleSolved && !isanimating) { arrowButtons[y].AddInteractionPunch(0.25f); MAudio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, arrowButtons[y].transform); CheckValidArrow(y); } return(false); }; } modSelf.OnActivate += OnActivate; }