构造函数
cc.Component对象
Protected _msgPrivate componentPrivate initPrivate schedulePrivate schedulesPrivate serverStatic Private times注册全局事件
事件名
处理事件的侦听器函数
侦听函数绑定的作用域对象
Private onPrivate on在指定对象上注册一个倒计时的回调管理器
export class Test extends Component {
private timeId!: string;
start() {
// 在指定对象上注册一个倒计时的回调管理器
this.timeId = oops.timer.register(this, "countDown", this.onSecond, this.onComplete);
}
private onSecond() {
console.log("每秒触发一次");
}
private onComplete() {
console.log("倒计时完成触发");
}
}
注册定时器的对象
时间字段
每秒事件
倒计时完成事件
在指定对象上注销一个倒计时的回调管理器
export class Test extends Component {
private timeId!: string;
start() {
this.timeId = oops.timer.register(this, "countDown", this.onSecond, this.onComplete);
}
onDestroy() {
// 在指定对象上注销一个倒计时的回调管理器
oops.timer.unRegister(this.timeId);
}
}
时间对象唯一表示
Generated using TypeDoc
时间管理