本文整理汇总了C++中IEntitySystem::RemoveEntityEventListener方法的典型用法代码示例。如果您正苦于以下问题:C++ IEntitySystem::RemoveEntityEventListener方法的具体用法?C++ IEntitySystem::RemoveEntityEventListener怎么用?C++ IEntitySystem::RemoveEntityEventListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEntitySystem
的用法示例。
在下文中一共展示了IEntitySystem::RemoveEntityEventListener方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Reset
void CVTOLVehicleManager::Reset()
{
//Drop all the registered Ids
IEntitySystem *pEntitySystem = gEnv->pEntitySystem;
for (TVTOLList::const_iterator it = m_vtolList.begin(), end = m_vtolList.end(); it != end; ++ it)
{
const EntityId vtolId = it->second.entityId;
pEntitySystem->RemoveEntityEventListener(vtolId, ENTITY_EVENT_RESET, this);
pEntitySystem->RemoveEntityEventListener(vtolId, ENTITY_EVENT_DONE, this);
pEntitySystem->RemoveEntityEventListener(vtolId, ENTITY_EVENT_HIDE, this);
pEntitySystem->RemoveEntityEventListener(vtolId, ENTITY_EVENT_UNHIDE, this);
}
m_vtolList.clear();
}
示例2: CancelCurrent
void CDialogActorContext::CancelCurrent(bool bResetStates)
{
if (!m_bNeedsCancel)
return;
assert (m_bInCancel == false);
if (m_bInCancel == true)
return;
m_bInCancel = true;
// remove from AG
if (m_pAGState != 0)
{
m_pAGState->RemoveListener(this);
if (bResetStates)
{
ResetAGState();
}
m_pAGState = 0;
}
m_queryID = 0;
m_bAnimStarted = false;
// reset lookat
IEntity* pEntity = gEnv->pEntitySystem->GetEntity(m_entityID);
if (pEntity)
{
IAIObject* pAI = pEntity->GetAI();
if (pAI)
{
IAIActor* pAIActor = pAI->CastToIAIActor();
if (pAIActor)
{
if (m_bLookAtNeedsReset)
{
pAIActor->ResetLookAt();
m_bLookAtNeedsReset = false;
}
IPipeUser* pPipeUser = pAI->CastToIPipeUser();
if (pPipeUser)
{
if (m_goalPipeID > 0)
{
if (GetAIBehaviourMode() == CDialogSession::eDIB_InterruptMedium)
{
int dummyPipe = 0;
ExecuteAI(dummyPipe, "ACT_DIALOG_OVER", 0, false);
}
pPipeUser->UnRegisterGoalPipeListener( this, m_goalPipeID );
pPipeUser->RemoveSubPipe(m_goalPipeID, true);
m_goalPipeID = 0;
}
if (m_exPosAnimPipeID > 0)
{
pPipeUser->UnRegisterGoalPipeListener( this, m_exPosAnimPipeID );
pPipeUser->CancelSubPipe(m_exPosAnimPipeID);
pPipeUser->RemoveSubPipe(m_exPosAnimPipeID, false);
m_exPosAnimPipeID = 0;
}
}
}
}
}
// facial expression is always reset
// if (bResetStates)
{
// Reset Facial Expression
IEntity* pActorEntity = m_pSession->GetActorEntity(m_actorID);
if (pActorEntity)
{
DoFacialExpression(pActorEntity, "", 1.0f, 0.0f);
}
}
// should we stop the current sound?
// we don't stop the sound if the actor aborts and has eDACF_NoAbortSound set.
// if actor died (entity destroyed) though, sound is stopped anyway
const bool bDontStopSound = (IsAborted() == false && CheckActorFlags(CDialogSession::eDACF_NoAbortSound))
|| (IsAborted()
&& CheckActorFlags(CDialogSession::eDACF_NoAbortSound)
&& GetAbortReason() != CDialogSession::eAR_ActorDead
&& GetAbortReason() != CDialogSession::eAR_EntityDestroyed);
if (bDontStopSound == false)
{
// stop sound (this also forces m_soundId to be INVALID_SOUNDID) and markes Context as non-playing!
// e.g. IsStillPlaying will then return false
// we explicitly stop the sound in the d'tor if we don't take this path here
StopSound();
}
IEntitySystem* pES = gEnv->pEntitySystem;
pES->RemoveEntityEventListener( m_entityID, ENTITY_EVENT_AI_DONE, this );
pES->RemoveEntityEventListener( m_entityID, ENTITY_EVENT_DONE, this );
pES->RemoveEntityEventListener( m_entityID, ENTITY_EVENT_RESET, this );
m_phase = eDAC_Idle;
//.........这里部分代码省略.........