cocos定时器

//Node定时器
	/*pMoveSprite = Sprite::create("tab4.png");
	pMoveSprite->setPosition(Vec2(200, 320));
	this->addChild(pMoveSprite, 2);
/*	this->scheduleUpdate();//生成一个定时器*/

	/*auto pDirector = Director::getInstance();//获取导演指针
	auto pScheduler = pDirector->getScheduler();//	通过导演获得Schedular指针
	pScheduler->schedule(SEL_SCHEDULE(&HelloWorld::SchCallback), this,0.1f, false);
	//this->scheduleOnce(SEL_SCHEDULE(&HelloWorld::SchCallback),0.0f);//该定时器只执行一次
	//bool IsRunning = pScheduler->isScheduled(SEL_SCHEDULE(&HelloWorld::heartBeat), this);//判断定时器是否在运行中
	//pScheduler->pauseTarget(this);//暂停
	//pScheduler->resumeTarget(this);//恢复
	//pScheduler->unschedule(SEL_SCHEDULE(&HelloWorld::heartBeat), this);//删除当前节点的一个定时器
	//pScheduler->unscheduleAllForTarget(this);//删除一个节点的所有定时器*/

你可能感兴趣的:(cocos定时器)