You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jeremy/Assets/Scripts/TrackStuff/MyButtonTrackMixer.cs

23 lines
547 B

using UnityEngine;
using UnityEngine.Playables;
public class MyButtonTrackMixer : PlayableBehaviour
{
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
{
var myButton = playerData as MyButton;
myButton!.isActive = false;
for (var i = 0; i < playable.GetInputCount(); i++)
{
var inputWeight = playable.GetInputWeight(i);
if (inputWeight > 0)
{
myButton.isActive = true;
}
}
}
}