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


C++ IEntity::DetachThis方法代码示例

本文整理汇总了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;
}
开发者ID:RenEvo,项目名称:dead6,代码行数:31,代码来源:Parachute.cpp

示例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;
}
开发者ID:joewan,项目名称:pycmake,代码行数:15,代码来源:VehiclePartAttachment.cpp

示例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!");
	}
}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:49,代码来源:Laser.cpp


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