本文整理汇总了C++中IScriptSystem::ReleaseFunc方法的典型用法代码示例。如果您正苦于以下问题:C++ IScriptSystem::ReleaseFunc方法的具体用法?C++ IScriptSystem::ReleaseFunc怎么用?C++ IScriptSystem::ReleaseFunc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScriptSystem
的用法示例。
在下文中一共展示了IScriptSystem::ReleaseFunc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CallCustomExecutionFunction
bool CCustomReactionFunctions::CallCustomExecutionFunction(ScriptTablePtr hitDeathReactionsTable, CActor& actor, const SReactionParams& reactionParams, const HitInfo& hitInfo) const
{
CRY_ASSERT(!reactionParams.sCustomExecutionFunc.empty());
bool bSuccess = false;
// try LUA first. This is so overriding C++ functions can be easily done on LUA, without the need to recompile or to change
// the name of the LUA methods in both reactionParams and script code
HSCRIPTFUNCTION executionFunc = NULL;
if (hitDeathReactionsTable->GetValue(reactionParams.sCustomExecutionFunc.c_str(), executionFunc))
{
IScriptSystem* pScriptSystem = hitDeathReactionsTable->GetScriptSystem();
bSuccess = Script::Call(pScriptSystem, executionFunc, hitDeathReactionsTable, reactionParams.reactionScriptTable);
pScriptSystem->ReleaseFunc(executionFunc);
}
// Try C++ now
if (!bSuccess)
{
// C++ custom execution
ExecutionFncContainer::const_iterator itFind = m_executionFunctors.find(reactionParams.sCustomExecutionFunc);
if (itFind != m_executionFunctors.end())
{
// [*DavidR | 21/Oct/2010] C++ custom functions have the advantage of receiving a reference to the hitinfo, LUA methods can get the "lastHit" so we
// avoid the expensive construction of the hitInfo table
itFind->second(actor, reactionParams, hitInfo);
bSuccess = true;
}
else
CHitDeathReactionsSystem::Warning("Couldn't find custom execution function (%s)", reactionParams.sCustomExecutionFunc.c_str());
}
return bSuccess;
}
示例2: OnCheckpointLoaded
void CCheckpointSystem::OnCheckpointLoaded(SCheckpointData metaData)
{
IEntity *pCheckpoint = gEnv->pEntitySystem->GetEntity(metaData.m_checkPointId);
if(pCheckpoint)
{
//Trigger OnLoad
IScriptTable *pScript = pCheckpoint->GetScriptTable();
if (pScript)
{
HSCRIPTFUNCTION hScriptFunc(NULL);
pScript->GetValue("Event_OnLoadCheckpoint", hScriptFunc);
if (hScriptFunc) //this will trigger the flowgraph output
{
IScriptSystem *pIScriptSystem = gEnv->pScriptSystem;
Script::Call(pIScriptSystem,hScriptFunc,pScript);
pIScriptSystem->ReleaseFunc(hScriptFunc);
}
}
}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:21,代码来源:CheckPointSystem.cpp