public Fade ( |
||
clip | Clip to fade in. | |
volume | float | Volume to fade to. |
loop | bool | Whether to loop the new clip, or not. |
return | void |
public void PlayPlaceMusic(EnvironmentManager.Place place) { switch (place) { case EnvironmentManager.Place.Title_Screen: backgroundMusic.Fade(titleMusic, MAX_VOLUME, true); //start the kitchen background noises foley.ToggleSound(OnOrOff.On); foley.Fade(kitchenBackgroundSFX, MAX_VOLUME, true); break; case EnvironmentManager.Place.Kitchen: backgroundMusic.Fade(kitchenMusic, MAX_VOLUME, true); //start the kitchen background noises foley.ToggleSound(OnOrOff.On); foley.Fade(kitchenBackgroundSFX, MAX_VOLUME, true); break; case EnvironmentManager.Place.Tavern: backgroundMusic.Fade(tavernMusic, MAX_VOLUME, true); foley.Fade(tavernBackgroundSFX, MAX_VOLUME, true); break; case EnvironmentManager.Place.Battlefield: //start the sword-clashing background sound foley.Fade(battleBackgroundSFX, MAX_VOLUME, true); break; } currentMusic = backgroundMusic.GetCurrentClip(); }
public void InitBoss() { bossBattle = true; rescueObjective.transform.parent.gameObject.SetActive(false); lootObjective.transform.parent.gameObject.SetActive(false); musicSource.Fade(bossMusic, 0.4f, true); }
// Update is called once per frame void Update() { for (int i = currentWaveUnits.Count - 1; i >= 0; i--) { Prototype_Nav enemy = currentWaveUnits[i]; if (enemy == null) { currentWaveUnits.RemoveAt(i); continue; } //LIFE ALWAYS BEING LOST IMMEDIATELY IF FIRST ARGUMENT IS GONE if (enemy.Agent.remainingDistance != 0 && enemy.Agent.remainingDistance < .1f) { waveLeft--; currentWaveUnits.RemoveAt(i); } } if (!shopPlaying && waveLeft == 0) { EndWave(); shopPlaying = true; music.Fade(shopMusic, 1f, true); } }
// Use this for initialization void Start() { normalClip = (AudioClip)Resources.Load(StringAssets.bgmPath + "Normal", typeof(AudioClip)); fightClip = new AudioClip[2]; fightClip[0] = (AudioClip)Resources.Load(StringAssets.bgmPath + "Fight1", typeof(AudioClip)); fightClip[1] = (AudioClip)Resources.Load(StringAssets.bgmPath + "Fight2", typeof(AudioClip)); fadingAudioSource.Fade(normalClip, bgmVolum, true); }
// Use this for initialization void Start() { music = GameObject.Find("Music Audio Source").GetComponent <FadingAudioSource> (); lives_track = gameObject.GetComponent <Lives_Tracker>(); shopPlaying = false; music.Fade(shopMusic, 1f, true); currentWaveUnits = new List <Prototype_Nav>(); //StartCoroutine(StartWave()); }
// Use this for initialization void Start() { music = gameObject.GetComponent <FadingAudioSource> (); music.Fade(shopMusic, 1f, true); }