コード例 #1
0
ファイル: space.cpp プロジェクト: 321543223/kbengine
//-------------------------------------------------------------------------------------
void Space::onLoadedSpaceGeometryMapping(NavigationHandlePtr pNavHandle)
{
	pNavHandle_ = pNavHandle;
	INFO_MSG(fmt::format("KBEngine::onLoadedSpaceGeometryMapping: spaceID={}, respath={}!\n",
			id(), getGeometryPath()));

	// 通知脚本
	SCRIPT_OBJECT_CALL_ARGS2(Cellapp::getSingleton().getEntryScript().get(), const_cast<char*>("onSpaceGeometryLoaded"), 
		const_cast<char*>("Is"), this->id(), getGeometryPath().c_str());

	onAllSpaceGeometryLoaded();
}
コード例 #2
0
//-------------------------------------------------------------------------------------
void Space::onAllSpaceGeometryLoaded()
{
	// 通知脚本
	SCRIPT_OBJECT_CALL_ARGS3(Cellapp::getSingleton().getEntryScript().get(), const_cast<char*>("onAllSpaceGeometryLoaded"), 
		const_cast<char*>("Iis"), this->getID(), true, getGeometryPath().c_str());


	SPACE_ENTITIES::iterator iter = entities_.begin();
	for(; iter != entities_.end(); iter++)
	{
		pNavHandle_->onEnterObject(iter->get()->layer(), iter->get()->getID(), iter->get()->getPosition());
	}
}
コード例 #3
0
ファイル: space.cpp プロジェクト: 321543223/kbengine
//-------------------------------------------------------------------------------------
bool Space::addSpaceGeometryMapping(std::string respath, bool shouldLoadOnServer)
{
	INFO_MSG(fmt::format("KBEngine::addSpaceGeometryMapping: spaceID={}, respath={}, shouldLoadOnServer={}!\n",
		id(), respath, shouldLoadOnServer));

	hasGeometry_ = true;
	if(getGeometryPath() == respath)
	{
		WARNING_MSG(fmt::format("KBEngine::addSpaceGeometryMapping: spaceID={}, respath={} is exist!\n",
			id(), respath));

		return true;
	}

	setGeometryPath(respath);

	if(shouldLoadOnServer)
		loadSpaceGeometry();

	return true;
}
コード例 #4
0
//-------------------------------------------------------------------------------------
bool Space::addSpaceGeometryMapping(std::string respath, bool shouldLoadOnServer)
{
	INFO_MSG(boost::format("KBEngine::addSpaceGeometryMapping: spaceID=%1%, respath=%2%, shouldLoadOnServer=%3%!\n") %
		getID() % respath % shouldLoadOnServer);

	hasGeometry_ = true;
	if(getGeometryPath() == respath)
	{
		WARNING_MSG(boost::format("KBEngine::addSpaceGeometryMapping: spaceID=%1%, respath=%2% is exist!\n") %
			getID() % respath);

		return true;
	}

	setGeometryPath(respath);

	if(shouldLoadOnServer)
		loadSpaceGeometry();

	return true;
}
コード例 #5
0
ファイル: space.cpp プロジェクト: 321543223/kbengine
//-------------------------------------------------------------------------------------
void Space::onAllSpaceGeometryLoaded()
{
	// 通知脚本
	SCRIPT_OBJECT_CALL_ARGS3(Cellapp::getSingleton().getEntryScript().get(), const_cast<char*>("onAllSpaceGeometryLoaded"), 
		const_cast<char*>("Iis"), this->id(), true, getGeometryPath().c_str());
}
コード例 #6
0
ファイル: space.cpp プロジェクト: 321543223/kbengine
//-------------------------------------------------------------------------------------
void Space::loadSpaceGeometry()
{
	KBE_ASSERT(pNavHandle_ == NULL);
	Cellapp::getSingleton().threadPool().addTask(new LoadNavmeshTask(getGeometryPath(), this->id()));
}