A lot of stuff to Commit because I forgot to Commit in between (Don't do stuff like this, kids)

This commit is contained in:
cblech
2025-01-05 13:47:14 +01:00
parent 03d130cde6
commit 8c961cbf2d
87 changed files with 22246 additions and 42 deletions
@@ -0,0 +1,31 @@
using TMPro;
using UnityEngine;
using UnityEngine.Playables;
public class SubtitleTrackMixer : PlayableBehaviour
{
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
{
var text = playerData as TextMeshProUGUI;
var currentText = "";
if (!text) { return; }
for (var i = 0; i < playable.GetInputCount(); i++)
{
if (playable.GetInputWeight(i) <=0)
continue;
var inputPlayable = (ScriptPlayable<SubtitleTrackBehaviour>)playable.GetInput(i);
var input = inputPlayable.GetBehaviour();
if (input.subtitleText != "")
{
currentText = input.subtitleText;
}
}
text.text = currentText;
}
}