UIFrame 1.1.7
Added
- 新增Timer定时器属性
// 实现一
class TestUI : UIBase
{
private UITimer timer = null;
protected override void OnBind()
{
timer = UIFrame.CreateTimer(delay: 1, UpdateEverySecond, isLoop: true);
}
protected override void OnUnbind()
{
timer.Cancel();
}
private void UpdateEverySecond()
{
// 每秒更新
}
}
// 上面的代码可以使用UITimer属性,简化成下面的
// 实现二
class TestUI: UIBase
{
[UITimer(delay: 1f, isLoop: true)]
private void UpdateEverySecond()
{
// 每秒更新
}
}