public override void ProcessFrame(Playable playable, FrameData info, object playerData) { this.m_TrackBinding = (playerData as Image); if (this.m_TrackBinding == null) { return; } if (!this.m_FirstFrameHappened) { this.m_DefaultColor = this.m_TrackBinding.color; this.m_FirstFrameHappened = true; } int inputCount = playable.GetInputCount <Playable>(); Color a = Color.clear; float num = 0f; float num2 = 0f; int num3 = 0; for (int i = 0; i < inputCount; i++) { float inputWeight = playable.GetInputWeight(i); ScreenFaderBehaviour behaviour = ((ScriptPlayable <T>)playable.GetInput(i)).GetBehaviour(); a += behaviour.color * inputWeight; num += inputWeight; if (inputWeight > num2) { num2 = inputWeight; } if (!Mathf.Approximately(inputWeight, 0f)) { num3++; } } this.m_TrackBinding.color = a + this.m_DefaultColor * (1f - num); }
public override void ProcessFrame(Playable playable, FrameData info, object playerData) { m_TrackBinding = playerData as Image; if (m_TrackBinding == null) { return; } if (!m_FirstFrameHappened) { m_DefaultColor = m_TrackBinding.color; m_FirstFrameHappened = true; } int inputCount = playable.GetInputCount(); Color blendedColor = Color.clear; float totalWeight = 0f; float greatestWeight = 0f; int currentInputs = 0; for (int i = 0; i < inputCount; i++) { float inputWeight = playable.GetInputWeight(i); ScriptPlayable <ScreenFaderBehaviour> inputPlayable = (ScriptPlayable <ScreenFaderBehaviour>)playable.GetInput(i); ScreenFaderBehaviour input = inputPlayable.GetBehaviour(); blendedColor += input.color * inputWeight; totalWeight += inputWeight; if (inputWeight > greatestWeight) { greatestWeight = inputWeight; } if (!Mathf.Approximately(inputWeight, 0f)) { currentInputs++; } } m_TrackBinding.color = blendedColor + m_DefaultColor * (1f - totalWeight); if (currentInputs != 1 && 1f - totalWeight > greatestWeight) { } }
public override void ProcessFrame(Playable playable, FrameData info, object playerData) { if (!m_FirstFrameHappened) { m_FirstFrameHappened = true; } int inputCount = playable.GetInputCount(); float blendedExposure = 0.0f; float totalWeight = 0f; float greatestWeight = 0f; int currentInputs = 0; for (int i = 0; i < inputCount; i++) { float inputWeight = playable.GetInputWeight(i); ScriptPlayable <ScreenFaderBehaviour> inputPlayable = (ScriptPlayable <ScreenFaderBehaviour>)playable.GetInput(i); ScreenFaderBehaviour input = inputPlayable.GetBehaviour(); blendedExposure += input.exposure * inputWeight; totalWeight += inputWeight; if (inputWeight > greatestWeight) { greatestWeight = inputWeight; } if (!Mathf.Approximately(inputWeight, 0f)) { currentInputs++; } } m_Exposure.compensation.Override(blendedExposure + 0.5f * (1.0f - totalWeight)); }