SeekOnEvent() public static method

public static SeekOnEvent ( string in_pszEventName, UnityEngine in_gameObjectID, float in_fPercent ) : AKRESULT
in_pszEventName string
in_gameObjectID UnityEngine
in_fPercent float
return AKRESULT
Ejemplo n.º 1
0
 // Seek to the current time, taking looping into account.
 // Return the proportion of the current event estimated duration that is left, after the seek.
 protected float seekToTime(Playable playable)
 {
     if (eventObject != null && akEvent != null)
     {
         float proportionalTime = getProportionalTime(playable);
         if (proportionalTime < 1.0f) // Avoids Wwise "seeking beyond end of event: audio will stop" error.
         {
             AkSoundEngine.SeekOnEvent((uint)akEvent.ID, eventObject, proportionalTime);
             return(1.0f - proportionalTime);
         }
     }
     return(1.0f);
 }
Ejemplo n.º 2
0
    protected override bool PlayInternal()
    {
        uint callbackFlags = (uint)(AkCallbackType.AK_EnableGetMusicPlayPosition | AkCallbackType.AK_MusicSyncEntry | AkCallbackType.AK_EndOfEvent);

        playingId_      = Event.Post(this.gameObject, callbackFlags, AkEventCallback);
        TransitionState = ETransitionState.Intro;

        if (seekTiming_ != null && seekTiming_ >= Timing.Zero)
        {
            AkSoundEngine.SeekOnEvent(Event.Id, gameObject, (int)DefaultMeter.GetMilliSecondsFromTiming(seekTiming_));
        }

        return(playingId_ != AkSoundEngine.AK_INVALID_PLAYING_ID);
    }
Ejemplo n.º 3
0
    // Seek to the current time, taking looping into account.
    private float SeekToTime(UnityEngine.Playables.Playable playable)
    {
        var proportionalTime = GetProportionalTime(playable);

        if (proportionalTime >= 1f)         // Avoids Wwise "seeking beyond end of event: audio will stop" error.
        {
            return(1f);
        }

        if (eventIsPlaying)
        {
            AkSoundEngine.SeekOnEvent(akEvent.Id, eventObject, proportionalTime);
        }
        return(proportionalTime);
    }