Пример #1
0
void HSGameShopLayer::setVisible(bool visible)
{
	#define HS_Shop_Tag 0x75699

	CCLayer::setVisible(visible);
	if(visible)
	{

		Shop_FlyIn(*m_p_shop_frame,m_shop_frame_Position);

		CCScene* pScene = CCDirector::sharedDirector()->getRunningScene();

		if (!pScene->getChildByTag(HS_Shop_Tag))
		{
			pScene->addChild(this,HS_Shop_Tag,HS_Shop_Tag);
		}
	}
	else
	{
		CCScene* pScene = CCDirector::sharedDirector()->getRunningScene();
		if (pScene->getChildByTag(HS_Shop_Tag))
		{
			pScene->removeChildByTag(HS_Shop_Tag);
		}
	}
}
void HSDailyRewardSystemLayer::setVisible( bool visible )
{
#define HS_DailyRewardSystemLayer_Tag 0x75699
	if (visible)
	{
		CCScene* pScene = CCDirector::sharedDirector()->getRunningScene();
		if (!pScene->getChildByTag(HS_DailyRewardSystemLayer_Tag))
		{
			pScene->addChild(this,HS_DailyRewardSystemLayer_Tag);
		}

	}else{
		CCScene* pScene = CCDirector::sharedDirector()->getRunningScene();
		if (pScene->getChildByTag(HS_DailyRewardSystemLayer_Tag))
		{
			pScene->removeChildByTag(HS_DailyRewardSystemLayer_Tag);
		}
	}
	CCLayer::setVisible(visible);
}