标签:-- event csharp dev function new t boolean void highlight
import flash.utils.Timer; var daojishiTimer:Timer; //是否添加 时间侦听 function addTimer(_isAdd: Boolean = true) { if (_isAdd) { daojishiTimer = new Timer(1000); daojishiTimer.addEventListener(TimerEvent.TIMER, yunxing); //运行时调用 daojishiTimer.start(); //启动计时器 } else { if (daojishiTimer) { daojishiTimer.removeEventListener(TimerEvent.TIMER, yunxing); daojishiTimer.stop(); daojishiTimer = null; } } } //运行时 function yunxing(evt: TimerEvent): void { dangqianshijian--; timetxt.text = "" + dangqianshijian + "s"; if (dangqianshijian == 0) { gameOver(); } }
标签:-- event csharp dev function new t boolean void highlight
原文地址:https://www.cnblogs.com/dt1991/p/12466194.html