首先创建timeLine并创建ctrl轨道
代码奉上=================》
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Timeline;
public class TimeLineDemo : MonoBehaviour,ITimeControl
{
public string str = "是否要情话足够动听,才能叫例外";
public Text text;
public void SetTime(double time)
{
if((int)(time*3)<str.Length)
{
text.text = str.Substring(0, (int)(time * 3));
}
else
{
text.text = str;
}
}
public void OnControlTimeStart()
{
print("OnControlTimeStart");
}
public void OnControlTimeStop()
{
print("OnControlTimeStop");
}
}
标签:UnityEngine,实现,TimeLine,void,time,打字机,text,using,public From: https://www.cnblogs.com/zanzz/p/17192003.html