From 5e0ea2be9226cc6edbf3ebd0fdcf3bcf2ebabb0c Mon Sep 17 00:00:00 2001 From: Nomango <569629550@qq.com> Date: Mon, 4 Dec 2017 11:18:38 +0800 Subject: [PATCH] =?UTF-8?q?ETimer=E5=A2=9E=E5=8A=A0setRunAtOnce=E5=87=BD?= =?UTF-8?q?=E6=95=B0=EF=BC=8C=E8=AE=A9=E5=AE=9A=E6=97=B6=E5=99=A8=E5=9C=A8?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=90=8E=E7=AB=8B=E5=8D=B3=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Easy2D/Tool/ETimer.cpp | 5 +++++ Easy2D/etools.h | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Easy2D/Tool/ETimer.cpp b/Easy2D/Tool/ETimer.cpp index d47d43ec..51732dd5 100644 --- a/Easy2D/Tool/ETimer.cpp +++ b/Easy2D/Tool/ETimer.cpp @@ -79,6 +79,11 @@ void e2d::ETimer::setRepeatTimes(int repeatTimes) m_nRepeatTimes = repeatTimes; } +void e2d::ETimer::setRunAtOnce(bool bAtOnce) +{ + m_bAtOnce = bAtOnce; +} + void e2d::ETimer::bindWith(EScene * pParentScene) { ETimerManager::bindTimer(this, pParentScene); diff --git a/Easy2D/etools.h b/Easy2D/etools.h index 198d1c88..966b6a4a 100644 --- a/Easy2D/etools.h +++ b/Easy2D/etools.h @@ -66,7 +66,12 @@ public: // 设置定时器重复执行次数 void setRepeatTimes( - int repeatTimes + int nRepeatTimes + ); + + // 设置定时器在绑定后立即执行一次 + virtual void setRunAtOnce( + bool bAtOnce ); // 绑定定时器到场景