FMOD.Studio.EventInstance.getPlaybackState C# (CSharp) Method

getPlaybackState() public method

public getPlaybackState ( PLAYBACK_STATE &state ) : RESULT
state PLAYBACK_STATE
return RESULT
        public RESULT getPlaybackState(out PLAYBACK_STATE state)
        {
            return FMOD_Studio_EventInstance_GetPlaybackState(rawPtr, out state);
        }
        public RESULT getChannelGroup(out FMOD.ChannelGroup group)

Usage Example

    // Update is called once per frame
    void Update()
    {
        var feet3DPosition = FMODUnity.RuntimeUtils.To3DAttributes(gameObject.transform.position);

        Footsteps.set3DAttributes(feet3DPosition);
        if (Input.GetKeyDown("w") || Input.GetKeyDown("a") || Input.GetKeyDown("s") || Input.GetKeyDown("d"))
        {
            PlayerIsWalking = true;
        }
        if (Input.GetKeyUp("w") || Input.GetKeyUp("a") || Input.GetKeyUp("s") || Input.GetKeyUp("d"))
        {
            PlayerIsWalking = false;
        }

        Footsteps.getPlaybackState(out FootstepsPlaybackState);

        if (PlayerIsWalking && FootstepsPlaybackState != FMOD.Studio.PLAYBACK_STATE.PLAYING && FootstepsPlaybackState != FMOD.Studio.PLAYBACK_STATE.STARTING)
        {
            Footsteps.start();
        }
        else if (!PlayerIsWalking)
        {
            Footsteps.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
        }
    }
All Usage Examples Of FMOD.Studio.EventInstance::getPlaybackState
EventInstance