Пример #1
0
 protected virtual void Update()
 {
     CheckForIntensityChange();
     AudioSourceLight.Update();
     AudioSourceMedium.Update();
     AudioSourceHeavy.Update();
 }
Пример #2
0
        protected virtual void Update()
        {
            if (!Application.isPlaying)
            {
                return;
            }

            UpdateExternalModifiers();
            CheckForIntensityChange();
            if (AudioSourceLight != null)
            {
                AudioSourceLight.Update();
            }
            if (AudioSourceMedium != null)
            {
                AudioSourceMedium.Update();
            }
            if (AudioSourceHeavy != null)
            {
                AudioSourceHeavy.Update();
            }
            if (MistMaterial != null)
            {
                MistMaterial.SetFloat(WMS._ParticleDitherLevel, DitherLevel);
            }
            UpdateParticleSystemPlayState();
            SetVolumeModifier(WeatherMakerAudioManagerScript.CachedWeatherVolumeModifier);
        }
 protected virtual void Update()
 {
     CheckForIntensityChange();
     AudioSourceLight.Update();
     AudioSourceMedium.Update();
     AudioSourceHeavy.Update();
     if (MistMaterial != null)
     {
         MistMaterial.SetFloat("_ParticleDitherLevel", DitherLevel);
     }
 }
Пример #4
0
        protected virtual void OnEnable()
        {
            if (!Application.isPlaying)
            {
                return;
            }

            if (WeatherMakerCommandBufferManagerScript.Instance != null)
            {
                WeatherMakerCommandBufferManagerScript.Instance.RegisterPreCull(CameraPreCull, this);
                WeatherMakerCommandBufferManagerScript.Instance.RegisterPostRender(CameraPostRender, this);
            }
            ParticleSystemRenderer          = (ParticleSystem == null ? null : ParticleSystem.gameObject.GetComponent <ParticleSystemRenderer>());
            MistParticleSystemRenderer      = (MistParticleSystem == null ? null : MistParticleSystem.gameObject.GetComponent <ParticleSystemRenderer>());
            ExplosionParticleSystemRenderer = (ExplosionParticleSystem == null ? null : ExplosionParticleSystem.gameObject.GetComponent <ParticleSystemRenderer>());
            ParticleSystemSecondaryRenderer = (ParticleSystemSecondary == null ? null : ParticleSystemSecondary.gameObject.GetComponent <ParticleSystemRenderer>());
            ResumeParticleSystem(ParticleSystem);
            ResumeParticleSystem(ParticleSystemSecondary);
            ResumeParticleSystem(MistParticleSystem);
            if (AudioSourceLight == null && LoopSourceLight != null)
            {
                AudioSourceLight = new WeatherMakerLoopingAudioSource(LoopSourceLight);
            }
            if (AudioSourceMedium == null && LoopSourceMedium != null)
            {
                AudioSourceMedium = new WeatherMakerLoopingAudioSource(LoopSourceMedium);
            }
            if (AudioSourceHeavy == null && LoopSourceHeavy != null)
            {
                AudioSourceHeavy = new WeatherMakerLoopingAudioSource(LoopSourceHeavy);
            }
            if (AudioSourceLight != null)
            {
                AudioSourceLight.Resume();
            }
            if (AudioSourceMedium != null)
            {
                AudioSourceMedium.Resume();
            }
            if (AudioSourceHeavy != null)
            {
                AudioSourceHeavy.Resume();
            }
        }