本文整理汇总了C++中IEntity::DetachThis方法的典型用法代码示例。如果您正苦于以下问题:C++ IEntity::DetachThis方法的具体用法?C++ IEntity::DetachThis怎么用?C++ IEntity::DetachThis使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEntity
的用法示例。
在下文中一共展示了IEntity::DetachThis方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Close
//------------------------------------------------------------------------
void CParachute::Close(bool drop/*=false*/)
{
// not used any more
return;
CryLog("Closing Parachute..");
if (m_actorId)
{
IEntity* pEnt = m_pEntitySystem->GetEntity(m_actorId);
if (pEnt && pEnt->GetParent()->GetId() == m_canvasId)
{
pEnt->DetachThis();
}
m_actorId = 0;
}
CActor* pActor = GetOwnerActor();
if (pActor)
{
pActor->LinkToVehicle(0);
if (IsOpened())
{
if (drop)
pActor->DropItem(GetEntity()->GetId(), 1.0f, false);
}
}
m_isOpened = false;
}
示例2: DetachAttachment
//------------------------------------------------------------------------
void CVehiclePartEntityAttachment::DetachAttachment()
{
if (m_attachmentId)
m_pVehicle->SetObjectUpdate(this, IVehicle::eVOU_NoUpdate);
IEntity* pEntity = GetAttachmentEntity();
if (pEntity)
{
pEntity->DetachThis();
}
m_attachmentId = 0;
}
示例3: SetLaserEntitySlots
void CLaserBeam::SetLaserEntitySlots(bool freeSlots)
{
if(m_pLaserParams)
{
IEntity* pLaserEntity = GetLaserEntity();
if(pLaserEntity)
{
if(freeSlots)
{
if(m_laserDotSlot != -1)
pLaserEntity->FreeSlot(m_laserDotSlot);
if(m_laserGeometrySlot != -1)
pLaserEntity->FreeSlot(m_laserGeometrySlot);
m_laserDotSlot = m_laserGeometrySlot = -1;
pLaserEntity->DetachThis();
if(m_usingEntityAttachment)
{
if(IAttachmentManager* pAttachmentManager = GetLaserCharacterAttachmentManager())
{
if(IAttachment* pAttachment = pAttachmentManager->GetInterfaceByName(LASER_ATTACH_NAME))
{
pAttachment->ClearBinding();
}
}
}
}
else
{
m_laserGeometrySlot = pLaserEntity->LoadGeometry(-1, m_pLaserParams->laser_geometry_tp.c_str());
pLaserEntity->SetSlotFlags(m_laserGeometrySlot, pLaserEntity->GetSlotFlags(m_laserGeometrySlot)|ENTITY_SLOT_RENDER);
if (m_pLaserParams->show_dot)
{
IParticleEffect* pEffect = gEnv->pParticleManager->FindEffect(m_pLaserParams->laser_dot[GetIndexFromGeometrySlot()].c_str());
if(pEffect)
m_laserDotSlot = pLaserEntity->LoadParticleEmitter(-1,pEffect);
}
FixAttachment(pLaserEntity);
}
}
}
else
{
GameWarning("LASER PARAMS: Item of type CLaser is missing it's laser params!");
}
}