using UnityEngine; using UnityEngine.Playables; using UnityEngine.Timeline; using TMPro; [System.Serializable] public class NumberScrollPlayableAsset : PlayableAsset { public ExposedReference textMesh; public int startValue; public int endValue; public ClipCaps clipCaps { get { return ClipCaps.None; } } public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { var playable = ScriptPlayable.Create(graph); NumberScrollPlayableBehaviour behaviour = playable.GetBehaviour(); behaviour.textMesh = textMesh.Resolve(graph.GetResolver()); behaviour.startValue = startValue; behaviour.endValue = endValue; return playable; } } [System.Serializable] public class NumberScrollBehaviour : PlayableBehaviour { public float startValue; public float endValue; }