当前位置: 首页>>代码示例>>C++>>正文


C++ IScriptSystem::SetGlobalValue方法代码示例

本文整理汇总了C++中IScriptSystem::SetGlobalValue方法的典型用法代码示例。如果您正苦于以下问题:C++ IScriptSystem::SetGlobalValue方法的具体用法?C++ IScriptSystem::SetGlobalValue怎么用?C++ IScriptSystem::SetGlobalValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IScriptSystem的用法示例。


在下文中一共展示了IScriptSystem::SetGlobalValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ClearCutSceneScriptVariables

void CCinematicInput::ClearCutSceneScriptVariables()
{
	IScriptSystem* pScriptSystem = gEnv->pScriptSystem;
	if (pScriptSystem)
	{
		pScriptSystem->SetGlobalValue("Cinematic_RumbleA", 0.0f);
		pScriptSystem->SetGlobalValue("Cinematic_RumbleB", 0.0f);

		pScriptSystem->SetGlobalValue("Cinematic_CameraLookUp", 0.0f);
		pScriptSystem->SetGlobalValue("Cinematic_CameraLookDown", 0.0f);
		pScriptSystem->SetGlobalValue("Cinematic_CameraLookLeft", 0.0f);
		pScriptSystem->SetGlobalValue("Cinematic_CameraLookRight", 0.0f);
	}
}
开发者ID:AiYong,项目名称:CryGame,代码行数:14,代码来源:CinematicInput.cpp

示例2: ClearCutSceneVariables

void CCinematicInput::ClearCutSceneVariables()
{
	IScriptSystem* pScriptSystem = gEnv->pScriptSystem;
	if (pScriptSystem)
	{
		pScriptSystem->SetGlobalValue("Cinematic_RumbleA", 0.0f);
		pScriptSystem->SetGlobalValue("Cinematic_RumbleB", 0.0f);

		pScriptSystem->SetGlobalValue("Cinematic_CameraLookUp", 0.0f);
		pScriptSystem->SetGlobalValue("Cinematic_CameraLookDown", 0.0f);
		pScriptSystem->SetGlobalValue("Cinematic_CameraLookLeft", 0.0f);
		pScriptSystem->SetGlobalValue("Cinematic_CameraLookRight", 0.0f);

		pScriptSystem->SetGlobalValue("Cinematic_CameraDoNotCenter", 0.0f);
	}

#if CINEMATIC_INPUT_PC_MOUSE
	m_mouseAccumulatedAngles.Set(0.0f, 0.0f, 0.0f);
	m_mouseAccumulatedInput.Set(0.0f, 0.0f, 0.0f);
	m_lastUpdateWithMouse = false;
#endif

	m_controllerAccumulatedAngles.Set(0.0f, 0.0f, 0.0f);
}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:24,代码来源:CinematicInput.cpp

示例3: LoadSurfaceTypes

bool CScriptSurfaceTypesLoader::LoadSurfaceTypes( const char *sFolder,bool bReload )
{
	{
		if (!gEnv->p3DEngine)
			return false;

		I3DEngine *pEngine = gEnv->p3DEngine;
		ISurfaceTypeEnumerator *pEnum = pEngine->GetMaterialManager()->GetSurfaceTypeManager()->GetEnumerator();
		if (pEnum)
		{
			for (ISurfaceType *pSurfaceType = pEnum->GetFirst(); pSurfaceType; pSurfaceType = pEnum->GetNext())
			{
				SmartScriptTable mtlTable(gEnv->pScriptSystem);
				gEnv->pScriptSystem->SetGlobalValue( pSurfaceType->GetName(),mtlTable );

				SmartScriptTable aiTable(gEnv->pScriptSystem);
				mtlTable->SetValue("AI",aiTable);
				aiTable->SetValue( "fImpactRadius",5.0f );
				aiTable->SetValue( "fFootStepRadius",15.0f );
				aiTable->SetValue( "proneMult",0.2f );
				aiTable->SetValue( "crouchMult",0.5f );
				aiTable->SetValue( "movingMult",2.5f );
			}

			pEnum->Release();
		}
	}

	return true; // Do not load surface types from script anymore.

	m_root = GetISystem()->CreateXmlNode("SurfaceTypes");

	IScriptSystem *pScriptSystem = gEnv->pScriptSystem;
	//////////////////////////////////////////////////////////////////////////
	// Make sure Materials table exist.
	//////////////////////////////////////////////////////////////////////////
	SmartScriptTable mtlTable;

	if (!pScriptSystem->GetGlobalValue("Materials", mtlTable) || bReload)
	{
		mtlTable = pScriptSystem->CreateTable();
		pScriptSystem->SetGlobalValue("Materials", mtlTable);
	}

	ICryPak *pIPak = gEnv->pCryPak;

	ISurfaceTypeManager *pSurfaceManager = gEnv->p3DEngine->GetMaterialManager()->GetSurfaceTypeManager();

	if (!bReload)
		stl::push_back_unique( m_folders,sFolder );

	string searchFolder = string(sFolder) + "/";;
	string searchFilter = searchFolder + "mat_*.lua";

	gEnv->pScriptSystem->ExecuteFile(searchFolder+"common.lua", false, bReload);

	_finddata_t fd;
	intptr_t fhandle;
	fhandle = pIPak->FindFirst( searchFilter,&fd );
	if (fhandle != -1)
	{
		do {
			// Skip back folders.
			if (fd.attrib & _A_SUBDIR) // skip if directory.
				continue;

			char name[_MAX_PATH];
			_splitpath( fd.name,NULL,NULL,name,NULL );

			if (strlen(name) == 0)
				continue;

			if (bReload)
			{
				ISurfaceType *pSurfaceType = pSurfaceManager->GetSurfaceTypeByName(name);
				if (pSurfaceType)
				{
					pSurfaceType->Load( pSurfaceType->GetId() );
					continue;
				}
			}

			ISurfaceType *pSurfaceType = new CScriptSurfaceType( this,name,searchFolder+fd.name,0 );
			if (pSurfaceManager->RegisterSurfaceType( pSurfaceType ))
				m_surfaceTypes.push_back(pSurfaceType);
			else
				pSurfaceType->Release();
		} while (pIPak->FindNext( fhandle,&fd ) == 0);
		pIPak->FindClose(fhandle);
	}

	if (m_root)
	{
		m_root->saveToFile( "SurfaceTypes.xml" );
	}

	return true;
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:98,代码来源:SurfaceTypes.cpp


注:本文中的IScriptSystem::SetGlobalValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。