private float Time(UnityEngine.Playables.Playable playable)
        {
            if (PlayReversed)
            {
                return((float)(playable.GetDuration() - playable.GetTime()));
            }

            return((float)playable.GetTime());
        }
        public override void ProcessFrame(UnityEngine.Playables.Playable playable, FrameData info, object playerData)
        {
            Target?.GoToTime(Time(playable));
            UpdateTime((float)playable.GetTime());

#if UNITY_EDITOR
            if (!Application.isPlaying)
            {
                Target.ManualUpdate(0);
            }
#endif
        }
Пример #3
0
        public override void PrepareFrame(UnityEngine.Playables.Playable playable, FrameData info)
        {
            _playable  = playable;
            _frameData = info;
            var currentTime = (float)playable.GetTime();

            if (info.evaluationType == FrameData.EvaluationType.Playback)
            {
                _trackPlayer.PlayByDeltaTime(currentTime - _previousTime);
            }
            _previousTime = currentTime;
        }
Пример #4
0
        public float GetValue(UnityEngine.Playables.Playable playable, MidiControl control)
        {
            var t = (float)(playable.GetTime() % midiTrack.TotalSeconds);

            switch (control.mode)
            {
            case MidiControl.Mode.NoteEnvelope:
                return(GetNoteEnvelopeValue(control, t));

            case MidiControl.Mode.NoteCurve:
                return(GetNoteCurveValue(control, t));

            case MidiControl.Mode.CC:
                return(GetCCValue(control, t));

            default:
                return(0);
            }
        }
Пример #5
0
 public override void OnGraphStart(UnityEngine.Playables.Playable playable)
 {
     _previousTime = (float)playable.GetTime();
     _trackPlayer.ResetHead(_previousTime);
 }