Beispiel #1
0
 public override void InitializeStates(out BaseState default_state)
 {
     default_state     = closed;
     base.serializable = true;
     closed.PlayAnim("on").Enter(delegate(StatesInstance smi)
     {
         if (smi.master.machineSound != null)
         {
             LoopingSounds component2 = smi.master.GetComponent <LoopingSounds>();
             if ((UnityEngine.Object)component2 != (UnityEngine.Object)null)
             {
                 component2.StartSound(GlobalAssets.GetSound(smi.master.machineSound, false));
             }
         }
     });
     open.PlayAnim("working").OnAnimQueueComplete(off).Exit(delegate(StatesInstance smi)
     {
         smi.master.DropContents();
     });
     off.PlayAnim("off").Enter(delegate(StatesInstance smi)
     {
         if (smi.master.machineSound != null)
         {
             LoopingSounds component = smi.master.GetComponent <LoopingSounds>();
             if ((UnityEngine.Object)component != (UnityEngine.Object)null)
             {
                 component.StopSound(GlobalAssets.GetSound(smi.master.machineSound, false));
             }
         }
     });
 }
 private void StopRotateSound()
 {
     if (rotate_sound_playing)
     {
         looping_sounds.StopSound(rotateSound);
         rotate_sound_playing = false;
     }
 }
Beispiel #3
0
 private void OnStopMiningSound(object data)
 {
     if (miningSoundEvent != null)
     {
         loopingSounds.StopSound(miningSoundEvent);
         miningSound = null;
     }
 }
Beispiel #4
0
        public void StopInhaleSound()
        {
            LoopingSounds component = GetComponent <LoopingSounds>();

            if ((Object)component != (Object)null)
            {
                component.StopSound(base.smi.inhaleSound);
            }
        }
Beispiel #5
0
    private void PlayImpactSound(Vector3 pos)
    {
        if (impactSound == null)
        {
            impactSound = "Meteor_Large_Impact";
        }
        loopingSounds.StopSound(flyingSound);
        string sound = GlobalAssets.GetSound(impactSound, false);

        if (CameraController.Instance.IsAudibleSound(pos, sound))
        {
            EventInstance instance = KFMOD.BeginOneShot(sound, pos);
            instance.setParameterValue("userVolume_SFX", KPlayerPrefs.GetFloat("Volume_SFX"));
            KFMOD.EndOneShot(instance);
        }
    }
    private void UpdateSound()
    {
        bool flag = isMoving && GetComponent <Navigator>().CurrentNavType != NavType.Swim;

        if (flag != isPlayingSound)
        {
            LoopingSounds component = GetComponent <LoopingSounds>();
            if (flag)
            {
                component.StartSound(sound);
            }
            else
            {
                component.StopSound(sound);
            }
            isPlayingSound = flag;
        }
    }