亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

cocos2dx Scene 生命周期(replaceScene,popScene后續補充)

發布時間:2020-05-30 18:24:22 來源:網絡 閱讀:1900 作者:破軍少帥 欄目:游戲開發

cocos2dx 在多場景切換中,生命周期打印的效果如下:


從 MyScene 場景進入,切換到 HelloWorld 場景,再推出 HelloWorld 場景,流程圖(見附件,,,,不知道怎么上傳圖片,不能粘貼圖,郁悶。。。)


打印 log 如下,


MyScene 代碼:
MyScene::MyScene() {
	CCLog("wangss------------->MyScene");
}
MyScene::~MyScene() {
	CCLog("wangss------------->~~MyScene");
}
void MyScene::onEnter() {
	CCLog("wangss------------->onEnter");
	Layer::onEnter();

}
void MyScene::onEnterTransitionDidFinish() {
	CCLog("wangss------------->onEnterTransitionDidFinish");
}
void MyScene::onExit() {
	CCLog("wangss------------->onExit");
	Layer::onExit();
}
void MyScene::onExitTransitionDidStart() {
	CCLog("wangss------------->onExitTransitionDidStart");
}
void MyScene::cleanup() {
	CCLog("wangss------------->cleanup");
}

Scene* MyScene::createScene() {
	CCLog("wangss------------->createScene");
	auto scene = Scene::create();
	auto layer = MyScene::create();
	scene->addChild(layer);
	return scene;
}
bool MyScene::init() {
	CCLog("wangss------------->init");
	if (!Layer::init()) {
		return false;
	}

	Size visibleSize = Director::getInstance()->getVisibleSize();
	Vec2 origin = Director::getInstance()->getVisibleOrigin();

	// spriteTest(visibleSize);
	// labelTest(visibleSize);
	// menuTest(visibleSize);
	// languageTest(visibleSize);
	// scheduleTest(visibleSize);
	// scaleNineSpriteTest(visibleSize);
	// shujujiegouTest(visibleSize);
	// actionTest(visibleSize);
	// actionCallBackTest(visibleSize);
	// frameAnimationTest(visibleSize);
	// actionEaseTest(visibleSize);
	// progressActionTest(visibleSize);
	lifeCycleTest(visibleSize);
	return true;
}


HelloWorld 代碼:

HelloWorld::HelloWorld() {
	CCLog("wangss------HelloWorld------->HelloWorld");
}
HelloWorld::~HelloWorld() {
	CCLog("wangss------HelloWorld------->~~HelloWorld");
}
void HelloWorld::onEnter() {
	CCLog("wangss------HelloWorld------->onEnter");
	Layer::onEnter();

}
void HelloWorld::onEnterTransitionDidFinish() {
	CCLog("wangss------HelloWorld------->onEnterTransitionDidFinish");
}
void HelloWorld::onExit() {
	CCLog("wangss------HelloWorld------->onExit");
	Layer::onExit();
}
void HelloWorld::onExitTransitionDidStart() {
	CCLog("wangss------HelloWorld------->onExitTransitionDidStart");
}
void HelloWorld::cleanup() {
	CCLog("wangss------HelloWorld------->cleanup");
}

Scene* HelloWorld::createScene()
{
	CCLog("wangss------HelloWorld------->createScene");

    // 'scene' is an autorelease object
    auto scene = Scene::create();
    
    // 'layer' is an autorelease object
    auto layer = HelloWorld::create();

    // add layer as a child to scene
    scene->addChild(layer);

    // return the scene
    return scene;
}

11-02 15:09:40.290: D/cocos2d-x debug info(23066): wangss------------->createScene

11-02 15:09:40.300: D/cocos2d-x debug info(23066): wangss------------->MyScene

11-02 15:09:40.300: D/cocos2d-x debug info(23066): wangss------------->init

11-02 15:09:40.320: D/cocos2d-x debug info(23066): wangss------------->onEnter

11-02 15:09:40.320: D/cocos2d-x debug info(23066): wangss------------->onEnterTransitionDidFinish

11-02 15:09:43.640: D/cocos2d-x debug info(23066): wangss------HelloWorld------->createScene

11-02 15:09:43.640: D/cocos2d-x debug info(23066): wangss------HelloWorld------->HelloWorld

11-02 15:09:43.640: D/cocos2d-x debug info(23066): wangss------HelloWorld------->init

11-02 15:09:43.760: D/cocos2d-x debug info(23066): wangss------------->onExitTransitionDidStart

11-02 15:09:43.760: D/cocos2d-x debug info(23066): wangss------HelloWorld------->onEnter

11-02 15:09:44.940: D/cocos2d-x debug info(23066): wangss------------->onExit

11-02 15:09:44.940: D/cocos2d-x debug info(23066): wangss------HelloWorld------->onEnterTransitionDidFinish

11-02 15:09:44.940: D/cocos2d-x debug info(23066): wangss------------->cleanup

11-02 15:09:44.940: D/cocos2d-x debug info(23066): wangss------------->~~MyScene

11-02 15:09:46.220: D/cocos2d-x debug info(23066): wangss------HelloWorld------->onExit

11-02 15:09:46.220: D/cocos2d-x debug info(23066): wangss------HelloWorld------->cleanup

11-02 15:09:46.220: D/cocos2d-x debug info(23066): wangss------HelloWorld------->~~HelloWorld




附件:http://down.51cto.com/data/2365029
向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

天祝| 丽水市| 托里县| 綦江县| 郁南县| 南投县| 吉林省| 刚察县| 获嘉县| 呈贡县| 呼玛县| 平果县| 铁岭市| 永春县| 桂平市| 宜兰县| 邯郸市| 赣榆县| 登封市| 澄迈县| 棋牌| 长乐市| 佳木斯市| 湘乡市| 内黄县| 高唐县| 铜陵市| 城口县| 虞城县| 盱眙县| 安康市| 南宁市| 阿鲁科尔沁旗| 垦利县| 时尚| 汕尾市| 永济市| 保山市| 屯留县| 随州市| 石嘴山市|