public override void ProcessFrame(Playable playable, FrameData info, object playerData) { _trackBinding = playerData as TBinding; if (_trackBinding == null) { return; } if (!FirstFrameHappened) { Default = GetState(_trackBinding); } ApplyState(Mix(playable, info, _trackBinding), _trackBinding); FirstFrameHappened = true; }
/// <summary> /// Mix the playables to produce an intermediate result representing the output of the mixer /// </summary> /// <param name="playable"></param> /// <param name="info"></param> /// <param name="trackBinding"></param> /// <returns></returns> protected abstract TIntermediate Mix(Playable playable, FrameData info, [NotNull] TBinding trackBinding);
/// <summary> /// Apply the output of the mixer to the given object /// </summary> /// <param name="intermediate"></param> /// <param name="trackBinding"></param> protected abstract void ApplyState(TIntermediate intermediate, [NotNull] TBinding trackBinding);
/// <summary> /// Get the state of the object /// </summary> /// <remarks> (used to retrieve the initial state)</remarks> /// <param name="trackBinding"></param> /// <returns></returns> protected abstract TIntermediate GetState([NotNull] TBinding trackBinding);