GetSourcePlayPosition() 공개 정적인 메소드

public static GetSourcePlayPosition ( uint in_PlayingID, int &out_puPosition ) : AKRESULT
in_PlayingID uint
out_puPosition int
리턴 AKRESULT
    // Update is called once per frame
    void Update()
    {
        if (!IsPlaying())
        {
            return;
        }

        int narrationPosMs = 0;

        AkSoundEngine.GetSourcePlayPosition(m_PlayingID, out narrationPosMs);

        if (m_currentLineIndex != m_previousLineIndex && m_currentLineIndex > 0)
        {
            string msg = string.Format("Time (ms): {0}, Subtitle: {1}", narrationPosMs, ms_subtitles[m_currentLineIndex]);
            Debug.Log(msg);

            m_previousLineIndex = m_currentLineIndex;
        }
    }
예제 #2
0
    IEnumerator LaunchNotes()
    {
        // Don't update Sequencer or launch notes if the song is paused (normal pause or rock'or'die pause)
        while (!_isEnded)
        {
            AkSoundEngine.GetSourcePlayPosition(wwiseEventIdSong, out playbackPosition);
            // "Optimization", just check notes that are in the near future, we don't need to check all notes each time
            var aroundNotes = _allNotes.FindAll(note => (note.time - timeToMove - 1.39f <= ((float)playbackPosition / 1000) + 2.0f) && !note.done);

            for (int i = 0; i < aroundNotes.Count; i++)
            {
                if ((aroundNotes[i].time - timeToMove - 1.39f) <= ((float)playbackPosition / 1000) && !aroundNotes[i].done)
                {
                    noteSpawner.LaunchNote(aroundNotes[i].line);
                    aroundNotes[i].done = true;
                }
            }

            yield return(new WaitForEndOfFrame());
        }
    }