unity脚本收集

This commit is contained in:
Abin committed 2025-08-01 10:50:57 +08:00
1 parent ab57544ef5
commit d88804cd63
16 files changed
+1325 -1

No files matched your search

@@ -0,0 +1,37 @@
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
using TMPro;
[System.Serializable]
public class NumberScrollPlayableAsset : PlayableAsset
{
public ExposedReference<TMP_Text> 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<NumberScrollPlayableBehaviour>.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;
}