Exemplo n.º 1
0
 private void CheckParticleVariables(WeatherMakerFallingParticleScript script)
 {
     if (script == null || script.AudioSourceLight == null || script.AudioSourceMedium == null || script.AudioSourceHeavy == null)
     {
         Debug.LogErrorFormat("{0} script and/or audio are null", script.gameObject);
     }
 }
Exemplo n.º 2
0
 private void SetVolumeModifier(WeatherMakerFallingParticleScript script, float volumeModifier)
 {
     if (script != null)
     {
         script.SetVolumeModifier(volumeModifier);
     }
 }
Exemplo n.º 3
0
 private void ChangePrecipitation(WeatherMakerFallingParticleScript newPrecipitation)
 {
     if (newPrecipitation != currentPrecipitation && currentPrecipitation != null)
     {
         TweenScript(currentPrecipitation, 0.0f);
         lastPrecipitationIntensityChange = -1.0f;
     }
     currentPrecipitation = newPrecipitation;
 }
Exemplo n.º 4
0
 private void ChangePrecipitation(WeatherMakerFallingParticleScript newPrecipitation)
 {
     if (newPrecipitation != PrecipitationScript && PrecipitationScript != null)
     {
         TweenScript(PrecipitationScript, 0.0f);
         lastPrecipitationIntensityChange = -1.0f;
     }
     PrecipitationScript = newPrecipitation;
 }
Exemplo n.º 5
0
        private void ChangePrecipitation(WeatherMakerFallingParticleScript newPrecipitation)
        {
            if (newPrecipitation != PrecipitationScript && PrecipitationScript != null)
            {
                // animate away from the current precipitation
                TweenPrecipitationScript(PrecipitationScript, 0.0f);
                lastPrecipitationIntensity = -1.0f;
            }

            // set new precipitation script
            PrecipitationScript = newPrecipitation;
        }
Exemplo n.º 6
0
 private void TweenScript(WeatherMakerFallingParticleScript script, float end)
 {
     if (Mathf.Abs(script.Intensity - end) < PrecipitationChangeThreshold)
     {
         script.Intensity = end;
     }
     else
     {
         TweenFactory.Tween("WeatherMakerPrecipitationChange_" + script.gameObject.GetInstanceID(), script.Intensity, end, PrecipitationChangeDuration, TweenScaleFunctions.Linear, (t) =>
         {
             // Debug.LogFormat("Tween key: {0}, value: {1}, prog: {2}", t.Key, t.CurrentValue, t.CurrentProgress);
             script.Intensity = t.CurrentValue;
         }, null);
     }
 }
Exemplo n.º 7
0
        private void TweenScript(WeatherMakerFallingParticleScript script, float end)
        {
            if (PrecipitationChangeDuration < 0.1f)
            {
                script.Intensity = end;
                return;
            }

            float      duration = (Mathf.Abs(script.Intensity - end) < PrecipitationChangeThreshold ? 0.0f : PrecipitationChangeDuration);
            FloatTween tween    = TweenFactory.Tween("WeatherMakerPrecipitationChange_" + script.gameObject.GetInstanceID(), script.Intensity, end, duration, TweenScaleFunctions.Linear, (t) =>
            {
                // Debug.LogFormat("Tween key: {0}, value: {1}, prog: {2}", t.Key, t.CurrentValue, t.CurrentProgress);
                script.Intensity = t.CurrentValue;
            });

            tween.Delay = PrecipitationChangeDelay;
        }