void ActivateParticles(bool on) { CustomPlayerFX.StartSnow(on); CustomPlayerFX.StartRain(on); CustomPlayerFX.StartClouds(on); CustomPlayerFX.StartFireflies(on); }
public void UpdateTemperature(Climate climate) { dir = UnityEngine.Random.Range(0f, 359f); windZone.transform.rotation = Quaternion.Euler(0f, -dir, 0f); ActivateParticles(false); Debug.Log(climate.climateType.ToString()); switch (climate.climateType) { case Climate.ClimateType.storm: strength = UnityEngine.Random.Range(5, 7); CustomPlayerFX.StartRain(true); PlayStorm(); PlayRain(); StartCoroutine(FlashThunder()); break; case Climate.ClimateType.rainy: strength = UnityEngine.Random.Range(4, 6); CustomPlayerFX.StartRain(true); PlayRain(); break; case Climate.ClimateType.cloudy: strength = UnityEngine.Random.Range(3, 5); CustomPlayerFX.StartClouds(true); PlayBirds(); break; case Climate.ClimateType.snowy: strength = UnityEngine.Random.Range(3, 6); CustomPlayerFX.StartSnow(true); break; default: ActivateParticles(false); strength = UnityEngine.Random.Range(1, 2); CustomPlayerFX.StartFireflies(true); if (temperature > 22) { PlayCicadas(); } else if (temperature > 10) { PlayBirds(); } break; } StartCoroutine(SetWindStrength(strength * .1f)); StartCoroutine(TransitionToVolume(strength / 50f)); }