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); }
protected override void SeekInternal(Timing seekTiming, int sequenceIndex = 0) { // ResetTimingOnEachBlockがfalseの時は、タイミングがブロックごとではなく // 全体で一つのものと判断されるので、sequenceIndex引数は無視されます。 if (ResetTimingOnEachBlock == false) { sequenceIndex = BlockInfos.Count - 1; for (int i = 1; i < BlockInfos.Count; ++i) { if (seekTiming.Bar < BlockInfos[i].StartBar) { sequenceIndex = i - 1; break; } } seekTiming = new Timing(seekTiming.Bar - BlockInfos[sequenceIndex].StartBar, seekTiming.Beat, seekTiming.Unit); } nextBlockIndex_ = sequenceIndex; currentBlockIndex_ = sequenceIndex; atomSource_.player.SetFirstBlockIndex(sequenceIndex); atomSource_.startTime = (int)Meter.GetMilliSecondsFromTiming(seekTiming); }