32 lines
771 B
C#
32 lines
771 B
C#
using UnityEngine;
|
|
using UnityEngine.Playables;
|
|
using UnityEngine.Video;
|
|
|
|
public class VideoPlayerMixerBehaviour : PlayableBehaviour
|
|
{
|
|
private VideoPlayer m_VideoPlayer;
|
|
|
|
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
|
|
{
|
|
m_VideoPlayer = playerData as VideoPlayer;
|
|
if (m_VideoPlayer == null) return;
|
|
|
|
int inputCount = playable.GetInputCount();
|
|
|
|
float maxWeight = 0f;
|
|
int dominantInput = -1;
|
|
|
|
for (int i = 0; i < inputCount; i++)
|
|
{
|
|
float weight = playable.GetInputWeight(i);
|
|
if (weight > maxWeight)
|
|
{
|
|
maxWeight = weight;
|
|
dominantInput = i;
|
|
}
|
|
}
|
|
|
|
// TODO
|
|
}
|
|
}
|