A bunch of stuff
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
[TrackBindingType(typeof(MyButton))]
|
||||
[TrackClipType(typeof(MyButtonTrackClip))]
|
||||
public class MyButtonTrack : TrackAsset
|
||||
{
|
||||
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
|
||||
{
|
||||
return ScriptPlayable<MyButtonTrackMixer>.Create(graph, inputCount);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 49ae3e466a6f42f46ad7b91a4848b95f
|
||||
@@ -0,0 +1,6 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
public class MyButtonTrackBehaviour : PlayableBehaviour
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 99322867652286d46b57271f5374d6fc
|
||||
@@ -0,0 +1,11 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
public class MyButtonTrackClip : PlayableAsset
|
||||
{
|
||||
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
|
||||
{
|
||||
var playable = ScriptPlayable<MyButtonTrackBehaviour>.Create(graph);
|
||||
return playable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f56a4c3fb40a3447ad70f8c9eaa3730
|
||||
@@ -0,0 +1,22 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24cbbbadd683a464a958616d2eb17eb5
|
||||
Reference in New Issue
Block a user