Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public class CameraMixerTimelineMixerBehaviour : PlayableBehaviour
internal PlayableDirector director;
internal CameraMixerTimelineTrack track;
private bool isFirstFrameHappened = false;

private HashSet<CameraPostProductionBase> postProductionSet = new();

// NOTE: This function is called at runtime and edit time. Keep that in mind when setting the values of properties.
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
{
Expand Down Expand Up @@ -78,7 +81,6 @@ public override void ProcessFrame(Playable playable, FrameData info, object play
ScriptPlayable<CameraMixerTimelineBehaviour> inputPlayable =
(ScriptPlayable<CameraMixerTimelineBehaviour>)playable.GetInput(i);
CameraMixerTimelineBehaviour input = inputPlayable.GetBehaviour();
input.cameraPostProductions.Distinct();

#if UNITY_EDITOR

Expand Down Expand Up @@ -152,11 +154,14 @@ public override void OnPlayableDestroy (Playable playable)

private void UpdatePostEffect( CameraMixerTimelineBehaviour input)
{
postProductionSet.Clear();

foreach (var postProduction in input.cameraPostProductions)
{
if (postProduction.progress != 0f)
if (postProduction.progress != 0f && !postProductionSet.Contains(postProduction))
{
postProduction.UpdateEffect(input.liveCamera, 0f, 0f);
postProductionSet.Add(postProduction);
}
}
}
Expand Down