Exemplo n.º 1
0
    public void PlayCamcorderLoop(Transform target, bool onOff, string eventPath)
    {
        PLAYBACK_STATE state = PLAYBACK_STATE.STOPPED;

        if (this.CamcorderLoopInstance == null && onOff)
        {
            this.CamcorderLoopInstance = FMOD_StudioSystem.instance.GetEvent(eventPath);
        }
        if (this.CamcorderLoopInstance != null)
        {
            UnityUtil.ERRCHECK(this.CamcorderLoopInstance.getPlaybackState(out state));
        }
        if (onOff)
        {
            UnityUtil.ERRCHECK(this.CamcorderLoopInstance.set3DAttributes(target.to3DAttributes()));
            if (!state.isPlaying())
            {
                UnityUtil.ERRCHECK(this.CamcorderLoopInstance.start());
            }
        }
        else
        {
            if (state.isPlaying())
            {
                UnityUtil.ERRCHECK(this.CamcorderLoopInstance.stop(STOP_MODE.ALLOWFADEOUT));
            }
            this.CamcorderLoopInstance = null;
        }
    }
        public void DeactivationTrigger()
        {
            //IL_0015: Unknown result type (might be due to invalid IL or missing references)
            //IL_001b: Unknown result type (might be due to invalid IL or missing references)
            //IL_001e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0020: Invalid comparison between Unknown and I4
            //IL_0051: Unknown result type (might be due to invalid IL or missing references)
            //IL_0056: Unknown result type (might be due to invalid IL or missing references)
            if (!m_eventInstance.isValid())
            {
                return;
            }
            PLAYBACK_STATE val = default(PLAYBACK_STATE);

            m_eventInstance.getPlaybackState(ref val);
            if ((int)val != 0 && (int)val != 3)
            {
                return;
            }
            if (m_stopDelay <= float.Epsilon)
            {
                if (m_stopDelayRoutine != null)
                {
                    this.StopCoroutine(m_stopDelayRoutine);
                    m_stopDelayRoutine = null;
                }
                m_eventInstance.stop(m_stopMode);
            }
            else if (m_stopDelayRoutine == null)
            {
                m_stopDelayRoutine = this.StartCoroutine(DelayStop());
            }
        }
Exemplo n.º 3
0
    public void PlayCamcorderRewindLoop(Transform target, bool onOff)
    {
        PLAYBACK_STATE state = PLAYBACK_STATE.STOPPED;

        if (this.CamcorderRewindLoopInstance == null && onOff && this.CamcorderRewindLoopEvent != null)
        {
            this.CamcorderRewindLoopInstance = FMOD_StudioSystem.instance.GetEvent(this.CamcorderRewindLoopEvent);
        }
        if (this.CamcorderRewindLoopInstance != null)
        {
            UnityUtil.ERRCHECK(this.CamcorderRewindLoopInstance.getPlaybackState(out state));
        }
        if (onOff)
        {
            UnityUtil.ERRCHECK(this.CamcorderRewindLoopInstance.set3DAttributes(target.to3DAttributes()));
            this.SyncLoopingEvent(this.CamcorderRewindLoopEvent, target.position);
            if (!state.isPlaying())
            {
                UnityUtil.ERRCHECK(this.CamcorderRewindLoopInstance.start());
            }
        }
        else
        {
            this.SyncLoopingEvent(string.Empty, Vector3.zero);
            if (state.isPlaying())
            {
                UnityUtil.ERRCHECK(this.CamcorderRewindLoopInstance.stop(STOP_MODE.IMMEDIATE));
            }
            this.CamcorderRewindLoopInstance = null;
        }
    }
 public void ActivationTrigger()
 {
     //IL_0024: Unknown result type (might be due to invalid IL or missing references)
     //IL_005a: Unknown result type (might be due to invalid IL or missing references)
     //IL_0060: Unknown result type (might be due to invalid IL or missing references)
     //IL_0062: Invalid comparison between Unknown and I4
     //IL_0064: Unknown result type (might be due to invalid IL or missing references)
     //IL_006e: Unknown result type (might be due to invalid IL or missing references)
     if (!m_sound.get_isValid())
     {
         return;
     }
     if (!m_eventInstance.isValid())
     {
         if (!AudioManager.isReady || !AudioManager.TryCreateInstance(m_sound, out m_eventInstance))
         {
             return;
         }
     }
     else
     {
         if (m_stopDelayRoutine != null)
         {
             this.StopCoroutine(m_stopDelayRoutine);
             m_stopDelayRoutine = null;
         }
         PLAYBACK_STATE val = default(PLAYBACK_STATE);
         m_eventInstance.getPlaybackState(ref val);
         if ((int)val == 3 || (int)val == 0)
         {
             return;
         }
     }
     m_eventInstance.start();
 }
Exemplo n.º 5
0
    private void Update()
    {
        CurrentSongState = GetAndUpdatePlaybackStateOfSong();
        float  tmpVolume;
        RESULT result = _eventInstance.getVolume(out tmpVolume, out CurrentVolumeReadOnly);

        if (result != RESULT.OK)
        {
            Debug.Log("Unable to get volume of track: " + result);
        }

        if (TriggerSongToStart)
        {
            SetPlaybackState(FMODSongState.Play);
            TriggerSongToStart = false;
        }
        if (TriggerSongToStop)
        {
            SetPlaybackState(FMODSongState.Stop);
            TriggerSongToStop = false;
        }

        if (SendParameterUpdate)
        {
            SetParameter(Parameter, Value);
            SendParameterUpdate = false;
        }

        if (_destroyWhenStopped && CurrentSongState == PLAYBACK_STATE.STOPPED)
        {
            Destroy(gameObject);
        }
    }
Exemplo n.º 6
0
    private void Update()
    {
        if (this.Remote)
        {
            return;
        }
        PLAYBACK_STATE pLAYBACK_STATE = PLAYBACK_STATE.STOPPED;

        if (this.musicTrack != null)
        {
            UnityUtil.ERRCHECK(this.musicTrack.getPlaybackState(out pLAYBACK_STATE));
        }
        if (pLAYBACK_STATE != PLAYBACK_STATE.STOPPED)
        {
            PlayerSfx.MusicPlaying = true;
        }
        else
        {
            PlayerSfx.MusicPlaying = false;
        }
        if (base.transform.hasChanged)
        {
            base.transform.hasChanged = false;
            ATTRIBUTES_3D attributes = UnityUtil.to3DAttributes(this.SfxPlayer, null);
            PlayerSfx.Set3DAttributes(this.staminaBreathInstance, attributes);
            PlayerSfx.Set3DAttributes(this.walkyTalkyInstance, attributes);
            PlayerSfx.Set3DAttributes(this.musicTrack, attributes);
            PlayerSfx.Set3DAttributes(this.afterStormInstance, this.SfxPlayer.transform.position.to3DAttributes());
        }
        if (this.afterStormInstance != null && !this.afterStormInstance.isValid())
        {
            this.afterStormInstance = null;
        }
        Vector3 vector = (base.GetComponent <Rigidbody>().position - this.prevPosition) / Time.deltaTime;

        this.prevPosition = base.GetComponent <Rigidbody>().position;
        Vector3 vector2 = new Vector3(vector.x, 0f, vector.z);

        this.flatVelocity = vector2.magnitude;
        if (!this.Buoyancy.InWater)
        {
            this.immersed = false;
        }
        else if (!this.immersed && !LocalPlayer.FpCharacter.Grounded && LocalPlayer.FpCharacter.IsAboveWaistDeep())
        {
            this.immersed = true;
            float num  = Mathf.Clamp(this.SplashSpeedMaximum - this.SplashSpeedMinimum, 0f, this.SplashSpeedMaximum);
            float num2 = (this.Buoyancy.LastWaterEnterSpeed - this.SplashSpeedMinimum) / num;
            if (num2 >= 0f)
            {
                FMOD.Studio.EventInstance @event = FMOD_StudioSystem.instance.GetEvent(this.SplashEvent);
                UnityUtil.ERRCHECK(@event.set3DAttributes(UnityUtil.to3DAttributes(this.SfxPlayer, null)));
                UnityUtil.ERRCHECK(@event.setParameterValue("speed", Mathf.Clamp01(num2)));
                UnityUtil.ERRCHECK(@event.start());
                UnityUtil.ERRCHECK(@event.release());
            }
        }
    }
Exemplo n.º 7
0
    public void PlaySongIfNoneAreCurrentlyPlaying(Songs.SongName songName)
    {
        PLAYBACK_STATE playbackState = GetAndUpdatePlaybackStateOfSong();

        if (playbackState == PLAYBACK_STATE.STOPPED)
        {
            SetSong(songName);
            SetPlaybackState(FMODSongState.Play);
        }
    }
 private void Update()
 {
     if (_waitingForSoundToFinish)
     {
         PLAYBACK_STATE otherFmodMusicPlayerState = GetAndUpdatePlaybackStateOfSoundEffect();
         if (otherFmodMusicPlayerState == PLAYBACK_STATE.STOPPED)
         {
             _waitingForSoundToFinish = false;
             _callback();
         }
     }
 }
Exemplo n.º 9
0
    public void PlayStaminaBreath()
    {
        PLAYBACK_STATE pLAYBACK_STATE = PLAYBACK_STATE.STOPPED;

        if (this.staminaBreathInstance != null && this.staminaBreathInstance.isValid())
        {
            UnityUtil.ERRCHECK(this.staminaBreathInstance.getPlaybackState(out pLAYBACK_STATE));
        }
        if (pLAYBACK_STATE == PLAYBACK_STATE.STOPPED)
        {
            this.staminaBreathInstance = this.PlayEvent(this.StaminaBreathEvent, this.SfxPlayer);
        }
    }
Exemplo n.º 10
0
    public PLAYBACK_STATE getPlaybackState()
    {
        if (!this.IsEventInstanceValid())
        {
            return(PLAYBACK_STATE.STOPPED);
        }
        PLAYBACK_STATE result = PLAYBACK_STATE.STOPPED;

        if (this.ERRCHECK(this.evt.getPlaybackState(out result)) == RESULT.OK)
        {
            return(result);
        }
        return(PLAYBACK_STATE.STOPPED);
    }
    public PLAYBACK_STATE getPlaybackState()
    {
        if (this.evt == null || !this.evt.isValid())
        {
            return(PLAYBACK_STATE.STOPPED);
        }
        PLAYBACK_STATE result = PLAYBACK_STATE.STOPPED;

        if (this.ERRCHECK(this.evt.getPlaybackState(out result)) == RESULT.OK)
        {
            return(result);
        }
        return(PLAYBACK_STATE.STOPPED);
    }
Exemplo n.º 12
0
 private void Update()
 {
     if (studioSystem.isValid() && IsInitialized)
     {
         studioSystem.update();
         bool flag         = false;
         bool flag2        = false;
         int  numListeners = 0;
         for (int num = 7; num >= 0; num--)
         {
             if (!flag && HasListener[num])
             {
                 numListeners = num + 1;
                 flag         = true;
                 flag2        = true;
             }
             if (!HasListener[num] && flag)
             {
                 flag2 = false;
             }
         }
         if (flag)
         {
             studioSystem.setNumListeners(numListeners);
         }
         if (!flag2 && !listenerWarningIssued)
         {
             listenerWarningIssued = true;
         }
         for (int i = 0; i < attachedInstances.Count; i++)
         {
             PLAYBACK_STATE state = PLAYBACK_STATE.STOPPED;
             attachedInstances[i].instance.getPlaybackState(out state);
             if (!attachedInstances[i].instance.isValid() || state == PLAYBACK_STATE.STOPPED || (UnityEngine.Object)attachedInstances[i].transform == (UnityEngine.Object)null)
             {
                 attachedInstances.RemoveAt(i);
                 i--;
             }
             else if ((bool)attachedInstances[i].rigidBody)
             {
                 attachedInstances[i].instance.set3DAttributes(RuntimeUtils.To3DAttributes(attachedInstances[i].transform, attachedInstances[i].rigidBody));
             }
             else
             {
                 attachedInstances[i].instance.set3DAttributes(RuntimeUtils.To3DAttributes(attachedInstances[i].transform, attachedInstances[i].rigidBody2D));
             }
         }
     }
 }
Exemplo n.º 13
0
 private void Update()
 {
     if (this.playerSightedInstance != null)
     {
         PLAYBACK_STATE state = PLAYBACK_STATE.STOPPED;
         if (this.playerSightedInstance.getPlaybackState(out state) == RESULT.OK && state.isPlaying())
         {
             UnityUtil.ERRCHECK(this.playerSightedInstance.set3DAttributes(base.transform.to3DAttributes()));
         }
         else
         {
             this.playerSightedInstance = null;
         }
     }
 }
Exemplo n.º 14
0
    /// <summary>
    /// 循环需要循环的音乐
    /// </summary>
    public void LoopPlay()
    {
        List <string> test = new List <string>(loopList.Keys);



        for (int i = 0; i < loopList.Count; i++)
        {
            EventInstance eve = loopList[test[i]];

            PLAYBACK_STATE state = PLAYBACK_STATE.PLAYING;
            eve.getPlaybackState(out state);
            if (state == PLAYBACK_STATE.STOPPED)
            {
                eve.start();
            }
        }
    }
Exemplo n.º 15
0
 private IEnumerator StartEventWhenStopped()
 {
     for (;;)
     {
         PLAYBACK_STATE state = PLAYBACK_STATE.STOPPED;
         if (this.IsEventInstanceValid())
         {
             this.ERRCHECK(this.evt.getPlaybackState(out state));
         }
         if (state == PLAYBACK_STATE.STOPPED)
         {
             break;
         }
         yield return(null);
     }
     this.StartEvent();
     yield break;
     yield break;
 }
Exemplo n.º 16
0
 public RESULT getPlaybackState(out PLAYBACK_STATE state)
 {
     return FMOD_Studio_CommandReplay_GetPlaybackState(rawPtr, out state);
 }
Exemplo n.º 17
0
 private static extern RESULT FMOD_Studio_EventInstance_GetPlaybackState     (IntPtr _event, out PLAYBACK_STATE state);
Exemplo n.º 18
0
 public RESULT getPlaybackState(out PLAYBACK_STATE state)
 {
     return FMOD_Studio_EventInstance_GetPlaybackState(rawPtr, out state);
 }
Exemplo n.º 19
0
 public RESULT getPlaybackState(out PLAYBACK_STATE state)
 {
     return(CommandReplay.FMOD_Studio_CommandReplay_GetPlaybackState(this.rawPtr, out state));
 }
 private static extern RESULT FMOD_Studio_CommandReplay_GetPlaybackState(IntPtr replay, out PLAYBACK_STATE state);
 public RESULT getPlaybackState(out PLAYBACK_STATE state)
 {
     return(FMOD_Studio_CommandReplay_GetPlaybackState(handle, out state));
 }
Exemplo n.º 22
0
        private void UpdateInternal()
        {
            //IL_006c: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00fd: Unknown result type (might be due to invalid IL or missing references)
            //IL_0109: Unknown result type (might be due to invalid IL or missing references)
            //IL_010e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0119: Unknown result type (might be due to invalid IL or missing references)
            //IL_0135: Unknown result type (might be due to invalid IL or missing references)
            //IL_013c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0141: Unknown result type (might be due to invalid IL or missing references)
            //IL_0144: Unknown result type (might be due to invalid IL or missing references)
            //IL_014b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0152: Unknown result type (might be due to invalid IL or missing references)
            //IL_0157: Unknown result type (might be due to invalid IL or missing references)
            //IL_0162: Unknown result type (might be due to invalid IL or missing references)
            //IL_017e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0185: Unknown result type (might be due to invalid IL or missing references)
            //IL_018a: Unknown result type (might be due to invalid IL or missing references)
            //IL_018d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0194: Unknown result type (might be due to invalid IL or missing references)
            //IL_01d3: Unknown result type (might be due to invalid IL or missing references)
            //IL_01d8: Unknown result type (might be due to invalid IL or missing references)
            //IL_01db: Unknown result type (might be due to invalid IL or missing references)
            //IL_01e0: Unknown result type (might be due to invalid IL or missing references)
            //IL_01f2: Unknown result type (might be due to invalid IL or missing references)
            //IL_01f9: Unknown result type (might be due to invalid IL or missing references)
            //IL_01fc: Invalid comparison between Unknown and I4
            //IL_0205: Unknown result type (might be due to invalid IL or missing references)
            //IL_021f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0226: Unknown result type (might be due to invalid IL or missing references)
            //IL_0229: Invalid comparison between Unknown and I4
            //IL_0232: Unknown result type (might be due to invalid IL or missing references)
            switch (state)
            {
            case State.None:
            case State.Loaded:
            case State.Playing:
            case State.Stopped:
            case State.Error:
                break;

            case State.Loading:
            {
                if ((m_musicBankLoadRequest != null && !m_musicBankLoadRequest.isDone) || (m_ambianceBankLoadRequest != null && !m_ambianceBankLoadRequest.isDone))
                {
                    break;
                }
                if (m_musicBankLoadRequest != null && AssetManagerError.op_Implicit(m_musicBankLoadRequest.error) != 0)
                {
                    Log.Warning("Could not load audio bank named '" + m_musicBankLoadRequest.bankName + "' for requested world music.", 149, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioWorldMusicRequest.cs");
                    Fail(m_musicBankLoadRequest.error);
                    break;
                }
                if (m_ambianceBankLoadRequest != null && AssetManagerError.op_Implicit(m_ambianceBankLoadRequest.error) != 0)
                {
                    Log.Warning("Could not load audio bank named '" + m_ambianceBankLoadRequest.bankName + "' for requested world ambiance.", 156, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Audio\\AudioWorldMusicRequest.cs");
                    Fail(m_ambianceBankLoadRequest.error);
                    break;
                }
                AudioReferenceWithParameters val3 = music;
                if (val3.get_isValid() && AudioManager.TryCreateInstance(music, out EventInstance eventInstance))
                {
                    if (context != null)
                    {
                        context.AddEventInstance(eventInstance);
                    }
                    val3 = music;
                    val3.ApplyParameters(eventInstance);
                    this.musicEventInstance = eventInstance;
                }
                val3 = ambiance;
                if (val3.get_isValid() && AudioManager.TryCreateInstance(ambiance, out EventInstance eventInstance2))
                {
                    if (context != null)
                    {
                        context.AddEventInstance(eventInstance2);
                    }
                    val3 = ambiance;
                    val3.ApplyParameters(eventInstance2);
                    this.ambianceEventInstance = eventInstance2;
                }
                state = State.Loaded;
                switch (m_pendingState)
                {
                case PendingStateChange.None:
                    break;

                case PendingStateChange.Play:
                    StartInternal();
                    break;

                case PendingStateChange.Stop:
                    UnloadInternal();
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
                break;
            }

            case State.Stopping:
            {
                EventInstance musicEventInstance    = this.musicEventInstance;
                EventInstance ambianceEventInstance = this.ambianceEventInstance;
                bool          flag = false;
                if (musicEventInstance.isValid())
                {
                    PLAYBACK_STATE val = default(PLAYBACK_STATE);
                    if ((int)musicEventInstance.getPlaybackState(ref val) == 0 && (int)val != 2)
                    {
                        flag = true;
                    }
                    else
                    {
                        musicEventInstance.release();
                        musicEventInstance.clearHandle();
                    }
                }
                if (ambianceEventInstance.isValid())
                {
                    PLAYBACK_STATE val2 = default(PLAYBACK_STATE);
                    if ((int)ambianceEventInstance.getPlaybackState(ref val2) == 0 && (int)val2 != 2)
                    {
                        flag = true;
                    }
                    else
                    {
                        ambianceEventInstance.release();
                        ambianceEventInstance.clearHandle();
                    }
                }
                if (!flag)
                {
                    UnloadInternal();
                    state = State.Stopped;
                }
                break;
            }

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
 private static extern RESULT FMOD_Studio_EventInstance_GetPlaybackState(IntPtr _event, out PLAYBACK_STATE state);
Exemplo n.º 24
0
 private static extern RESULT FMOD_Studio_CommandReplay_GetPlaybackState(IntPtr replay, out PLAYBACK_STATE state);
Exemplo n.º 25
0
    private void Update()
    {
        if (this.Remote)
        {
            return;
        }
        PLAYBACK_STATE playback_STATE = PLAYBACK_STATE.STOPPED;

        if (this.musicTrack != null)
        {
            UnityUtil.ERRCHECK(this.musicTrack.getPlaybackState(out playback_STATE));
        }
        if (playback_STATE != PLAYBACK_STATE.STOPPED)
        {
            PlayerSfx.MusicPlaying = true;
        }
        else
        {
            PlayerSfx.MusicPlaying = false;
        }
        if (base.transform.hasChanged)
        {
            base.transform.hasChanged = false;
            ATTRIBUTES_3D attributes = UnityUtil.to3DAttributes(this.SfxPlayer, null);
            PlayerSfx.Set3DAttributes(this.staminaBreathInstance, attributes);
            PlayerSfx.Set3DAttributes(this.walkyTalkyInstance, attributes);
            PlayerSfx.Set3DAttributes(this.musicTrack, attributes);
            PlayerSfx.Set3DAttributes(this.TurtleShellSledLoopInstance, attributes);
            ATTRIBUTES_3D attributes2 = this.SfxPlayer.transform.position.to3DAttributes();
            PlayerSfx.Set3DAttributes(this.afterStormInstance, attributes2);
            PlayerSfx.Set3DAttributes(this.onOceanInstance, attributes2);
        }
        if (this.afterStormInstance != null && !this.afterStormInstance.isValid())
        {
            this.afterStormInstance = null;
        }
        this.sledOnTerrain = base.GetComponent <FirstPersonCharacter>().terrainContact;
        if (this.sledIsPlaying)
        {
            UnityUtil.ERRCHECK(this.TurtleShellSledLoopSpeedParameter.setValue(LocalPlayer.Rigidbody.velocity.sqrMagnitude / 200f));
        }
        if (this.sledIsPlaying && LocalPlayer.FpCharacter.Grounded)
        {
            UnityUtil.ERRCHECK(this.TurtleShellSledLoopAirParameter.setValue(0f));
        }
        else if (this.sledIsPlaying && !LocalPlayer.FpCharacter.Grounded)
        {
            UnityUtil.ERRCHECK(this.TurtleShellSledLoopAirParameter.setValue(1f));
        }
        if (this.sledIsPlaying && LocalPlayer.FpCharacter.inSnow)
        {
            UnityUtil.ERRCHECK(this.TurtleShellSledLoopSnowParameter.setValue(1f));
        }
        else if (this.sledIsPlaying && !LocalPlayer.FpCharacter.inSnow)
        {
            UnityUtil.ERRCHECK(this.TurtleShellSledLoopSnowParameter.setValue(0f));
        }
        Vector3 vector = (base.GetComponent <Rigidbody>().position - this.prevPosition) / Time.deltaTime;

        this.prevPosition = base.GetComponent <Rigidbody>().position;
        Vector3 vector2 = new Vector3(vector.x, 0f, vector.z);

        this.flatVelocity = vector2.magnitude;
        if (!this.Buoyancy.InWater)
        {
            this.immersed = false;
        }
        else if (!this.immersed && !LocalPlayer.FpCharacter.Grounded && LocalPlayer.FpCharacter.IsAboveWaistDeep())
        {
            this.immersed = true;
            float num  = Mathf.Clamp(this.SplashSpeedMaximum - this.SplashSpeedMinimum, 0f, this.SplashSpeedMaximum);
            float num2 = (this.Buoyancy.LastWaterEnterSpeed - this.SplashSpeedMinimum) / num;
            if (num2 >= 0f)
            {
                EventInstance @event = FMOD_StudioSystem.instance.GetEvent(this.SplashEvent);
                UnityUtil.ERRCHECK(@event.set3DAttributes(UnityUtil.to3DAttributes(this.SfxPlayer, null)));
                UnityUtil.ERRCHECK(@event.setParameterValue("speed", Mathf.Clamp01(num2)));
                UnityUtil.ERRCHECK(@event.start());
                UnityUtil.ERRCHECK(@event.release());
            }
        }
        if (this.Buoyancy.InWater && this.Buoyancy.IsOcean)
        {
            if (this.onOceanInstance == null)
            {
                this.onOceanInstance = FMODCommon.PlayOneshot("event:/ambient/water/on_ocean", base.transform);
            }
        }
        else if (this.onOceanInstance != null)
        {
            UnityUtil.ERRCHECK(this.onOceanInstance.stop(STOP_MODE.ALLOWFADEOUT));
            UnityUtil.ERRCHECK(this.onOceanInstance.release());
            this.onOceanInstance = null;
        }
    }
Exemplo n.º 26
0
 public static bool isPlaying(this PLAYBACK_STATE state)
 {
     return(state == PLAYBACK_STATE.PLAYING || state == PLAYBACK_STATE.STARTING);
 }
 public RESULT getPlaybackState(out PLAYBACK_STATE state)
 {
     return(FMOD_Studio_EventInstance_GetPlaybackState(rawPtr, out state));
 }