Ejemplo n.º 1
0
 public void Build(HullSoundEngineController engine, float prevRPM, float nextRPM, float blendRange)
 {
     this.hullSoundEngine = engine;
     this.rangeBeginRPM   = Mathf.Lerp(this.rpm, prevRPM, blendRange);
     this.rangeEndRPM     = Mathf.Lerp(this.rpm, nextRPM, blendRange);
     this.activeRPMSound.Build(this);
     this.normalRPMSound.Build(this);
 }
Ejemplo n.º 2
0
        public virtual void Build(HullSoundEngineController engine, AbstractRPMSoundModifier abstractRPMSoundModifier, RPMSoundBehaviour rpmSoundBehaviour)
        {
            RPMVolumeUpdaterFinishBehaviour component = base.gameObject.GetComponent <RPMVolumeUpdaterFinishBehaviour>();

            if (component != null)
            {
                DestroyImmediate(component);
            }
            this.engine            = engine;
            this.parentModifier    = abstractRPMSoundModifier;
            this.rpmSoundBehaviour = rpmSoundBehaviour;
        }
Ejemplo n.º 3
0
        private void InitTankEngineSoundEffect(InitialTankEngineSoundEffectNode tank, bool self)
        {
            GameObject obj3 = Object.Instantiate <GameObject>(tank.tankEngineSoundEffect.EnginePrefab);
            Transform  soundRootTransform = tank.tankSoundRoot.SoundRootTransform;

            obj3.transform.parent        = soundRootTransform;
            obj3.transform.localPosition = Vector3.zero;
            obj3.transform.localRotation = Quaternion.identity;
            HullSoundEngineController component = obj3.GetComponent <HullSoundEngineController>();

            component.Init(self);
            tank.tankEngineSoundEffect.SoundEngineController = component;
            tank.Entity.AddComponent <TankEngineSoundEffectReadyComponent>();
        }
        public void Build(RPMSoundBehaviour rpmSoundBehaviour)
        {
            this.rpmSoundBehaviour = rpmSoundBehaviour;
            this.targetRPM         = rpmSoundBehaviour.RPM;
            HullSoundEngineController hullSoundEngine = rpmSoundBehaviour.HullSoundEngine;

            if (hullSoundEngine.UseAudioFilters)
            {
                this.InitChildUpdater <RPMAudioFilter, RPMVolumeUpdater>();
            }
            else
            {
                this.InitChildUpdater <RPMVolumeUpdater, RPMAudioFilter>();
            }
            this.childUpdater.Build(hullSoundEngine, this, rpmSoundBehaviour);
        }
Ejemplo n.º 5
0
 public override void Build(HullSoundEngineController engine, AbstractRPMSoundModifier abstractRPMSoundModifier, RPMSoundBehaviour rpmSoundBehaviour)
 {
     base.Build(engine, abstractRPMSoundModifier, rpmSoundBehaviour);
     this.rpmVolumeUpdaterFinishBehaviour = base.gameObject.AddComponent <RPMVolumeUpdaterFinishBehaviour>();
     this.rpmVolumeUpdaterFinishBehaviour.Build(base.parentModifier.Source);
 }