本文整理汇总了C++中IScriptTable::SetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ IScriptTable::SetValue方法的具体用法?C++ IScriptTable::SetValue怎么用?C++ IScriptTable::SetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScriptTable
的用法示例。
在下文中一共展示了IScriptTable::SetValue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AttachTo
//------------------------------------------------------------------------
void CScriptBind_Vehicle::AttachTo(IVehicle *pVehicle)
{
IScriptTable *pScriptTable = pVehicle->GetEntity()->GetScriptTable();
if (!pScriptTable)
return;
SmartScriptTable thisTable(gEnv->pScriptSystem);
thisTable->SetValue("vehicleId", ScriptHandle(pVehicle->GetEntityId()));
thisTable->Delegate(GetMethodsTable());
pScriptTable->SetValue("vehicle", thisTable);
SmartScriptTable seatTable(gEnv->pScriptSystem);
pScriptTable->SetValue("Seats", seatTable);
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:16,代码来源:ScriptBind_Vehicle.cpp
示例2: AttachTo
//------------------------------------------------------------------------
void CScriptBind_MatchMaking::AttachTo( CMatchMakingHandler* pMatchMaking, CGameLobbyManager *pLobbyManager )
{
m_pLobbyManager = pLobbyManager;
IScriptTable *pScriptTable = pMatchMaking->GetScriptTable();
if (pScriptTable)
{
SmartScriptTable thisTable(m_pSS);
thisTable->Delegate(GetMethodsTable());
pScriptTable->SetValue("bindings", thisTable);
}
}
示例3: AttachTo
//------------------------------------------------------------------------
void CScriptBind_Inventory::AttachTo(CInventory* pInventory)
{
IScriptTable *pScriptTable = pInventory->GetEntity()->GetScriptTable();
if (pScriptTable)
{
SmartScriptTable thisTable(m_pSS);
thisTable->SetValue("__this", ScriptHandle(pInventory));
thisTable->Delegate(GetMethodsTable());
pScriptTable->SetValue("inventory", thisTable);
}
}
示例4: AttachTo
//------------------------------------------------------------------------
void CScriptBind_Weapon::AttachTo(CWeapon *pWeapon)
{
IScriptTable *pScriptTable = ((CItem *)pWeapon)->GetEntity()->GetScriptTable();
if (pScriptTable)
{
SmartScriptTable thisTable(m_pSS);
thisTable->SetValue("__this", ScriptHandle(pWeapon->GetEntityId()));
thisTable->Delegate(GetMethodsTable());
pScriptTable->SetValue("weapon", thisTable);
}
}
示例5: AttachTo
//------------------------------------------------------------------------
void CScriptBind_Item::AttachTo(CItem *pItem)
{
IScriptTable *pScriptTable = pItem->GetEntity()->GetScriptTable();
if (pScriptTable)
{
SmartScriptTable thisTable(m_pSS);
thisTable->SetValue("__this", ScriptHandle(pItem->GetEntityId()));
thisTable->Delegate(GetMethodsTable());
pScriptTable->SetValue("item", thisTable);
}
}
示例6: AttachTo
//------------------------------------------------------------------------
void CScriptBind_Actor::AttachTo(CActor *pActor)
{
IScriptTable *pScriptTable = pActor->GetEntity()->GetScriptTable();
if (pScriptTable)
{
SmartScriptTable thisTable(m_pSS);
thisTable->SetValue("__this", ScriptHandle(pActor->GetEntityId()));
thisTable->Delegate(GetMethodsTable());
pScriptTable->SetValue("actor", thisTable);
}
}
示例7: AttachTo
void CScriptBind_NetworkBuilding::AttachTo( CNetworkBuilding *pInteractiveObject )
{
IScriptTable *pScriptTable = pInteractiveObject->GetEntity()->GetScriptTable();
if (pScriptTable)
{
SmartScriptTable thisTable(m_pSS);
thisTable->SetValue("__this", ScriptHandle(pInteractiveObject->GetEntityId()));
thisTable->Delegate(GetMethodsTable());
pScriptTable->SetValue("networkBuilding", thisTable);
}
m_NetworkBuildingMap.insert(TNetworkBuildingMap::value_type(pInteractiveObject->GetEntityId(), pInteractiveObject));
}
示例8: CreateEntities
//.........这里部分代码省略.........
bool bHasCgfFile = gEnv->pCryPak->IsFileExist(m_modelCgf) && m_bc.animationMaxDistanceSq > 0;
if(!bHasCgfFile)
m_bc.animationMaxDistanceSq = 0;
bool bAnyCreated = false;
for (Boids::iterator it = m_boids.begin(); it != m_boids.end(); ++it)
{
CBoidObject *boid = *it;/*m_boids[i]*/;
if (boid->m_dead || boid->m_dying)
continue;
spawnParams.vPosition = boid->m_pos;
spawnParams.vScale = Vec3(boid->m_scale,boid->m_scale,boid->m_scale);
spawnParams.id = 0;
IEntity *pBoidEntity = gEnv->pEntitySystem->SpawnEntity( spawnParams );
if (!pBoidEntity)
{
//delete boid;
//it = m_boids.erase(it);
continue;
}
boid->m_noentity = false;
boid->m_entity = pBoidEntity->GetId();
CBoidObjectProxyPtr pBoidObjectProxy = ComponentCreateAndRegister_DeleteWithRelease<CBoidObjectProxy>( IComponent::SComponentInitializer(pBoidEntity), true );
pBoidEntity->SetProxy(ENTITY_PROXY_BOID_OBJECT,pBoidObjectProxy);
pBoidObjectProxy->SetBoid(boid);
// check if character.
if (IsCharacterFile(m_model))
{
if(bHasCgfFile)
pBoidEntity->LoadGeometry(CBoidObject::eSlot_Cgf, m_modelCgf);
pBoidEntity->LoadCharacter( CBoidObject::eSlot_Chr,m_model );
boid->m_object = pBoidEntity->GetCharacter(0);
if (!boid->m_object)
{
gEnv->pEntitySystem->RemoveEntity(boid->m_entity,true);
boid->m_entity = 0;
//delete boid;
//it = m_boids.erase(it);
continue;
}
}
else
{
pBoidEntity->LoadGeometry( 0,m_model );
}
bAnyCreated = true;
// boid->m_object->GetModel()->AddRef();
AABB aabb;
if (boid->m_object)
{
boid->m_object->SetFlags( CS_FLAG_DRAW_MODEL|CS_FLAG_UPDATE );
boid->PlayAnimation( m_boidDefaultAnimName,true );
aabb = boid->m_object->GetAABB();
}
else
{
pBoidEntity->GetLocalBounds(aabb);
}
float fBBoxRadius = ((aabb.max-aabb.min).GetLength()/2.0f);
m_bc.fBoidRadius = max( fBBoxRadius, 0.001f );
m_bc.fBoidThickness = m_bc.fBoidRadius;
if (!m_bc.vEntitySlotOffset.IsZero())
{
pBoidEntity->SetSlotLocalTM(0,Matrix34::CreateTranslationMat(m_bc.vEntitySlotOffset*fBBoxRadius));
}
boid->Physicalize(m_bc);
IEntityRenderProxy *pRenderProxy = (IEntityRenderProxy*)pBoidEntity->GetProxy(ENTITY_PROXY_RENDER);
if (pRenderProxy != NULL && m_bc.fBoidRadius > 0)
{
float r = m_bc.fBoidRadius;
AABB box;
box.min = Vec3(-r,-r,-r);
box.max = Vec3(r,r,r);
pRenderProxy->SetLocalBounds( box,true );
}
IScriptTable *pScriptTable = pBoidEntity->GetScriptTable();
if (pScriptTable)
{
pScriptTable->SetValue( "flock_entity",m_pEntity->GetScriptTable() );
}
}
m_bEntityCreated = true;
return bAnyCreated;
}