Files
tools/Unity C++脚本/NumberScrollPlayable.cs
2025-08-01 10:50:57 +08:00

31 lines
621 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
[RequireComponent(typeof(TextMesh))]
public class NumberScrollPlayable : MonoBehaviour, INotificationReceiver
{
public PlayableDirector director;
public void OnNotify(Playable origin, INotification notification, object context)
{
}
void OnEnable()
{
if (director != null)
{
director.Play();
}
}
void Update()
{
if (director != null && director.state != PlayState.Playing)
{
director.Play();
}
}
}