コード例 #1
0
bool CMonoActor::ReloadExtension( IGameObject *pGameObject, const SEntitySpawnParams &params )
{
	CRY_ASSERT(GetGameObject() == pGameObject);

	ResetGameObject();

	if (!GetGameObject()->CaptureView(this))
		return false;
	if (!GetGameObject()->CaptureProfileManager(this))
		return false;

	// Re-enable the physics post step callback and CollisionLogging (were cleared during ResetGameObject()).
	GetGameObject()->EnablePhysicsEvent( true, eEPE_OnPostStepImmediate | eEPE_OnCollisionLogged);

	if (!GetGameObject()->BindToNetwork())
		return false;

	gEnv->pGameFramework->GetIActorSystem()->RemoveActor(params.prevId);
	gEnv->pGameFramework->GetIActorSystem()->AddActor(GetEntityId(), this);

	SetAspectProfile(eEA_Physics, eAP_NotPhysicalized);

	return true;
}
コード例 #2
0
ファイル: GunTurret.cpp プロジェクト: super-nova/NovaRepo
//----------------------------------------------------------------------
void CGunTurret::DestroyedGeometry(bool use)
{
	m_destroyed = use;

	CItem::DestroyedGeometry(use);

	if(!m_geometry[eIGS_Destroyed].empty())
	{
		if(use)
		{
			GetEntity()->SetSlotLocalTM(eIGS_Destroyed, GetEntity()->GetSlotLocalTM(eIGS_ThirdPerson, false));
		}

		DrawSlot(eIGS_Aux1,!use);
		SetAspectProfile(eEA_Physics, eIPhys_PhysicalizedRigid);
		UpdatePhysics();
	}

	if(use)
	{
		EnableUpdate(false, eIUS_General);
		Quiet();
	}
}