Exemplo n.º 1
0
void CMonoEntityExtension::ProcessEvent(SEntityEvent &event)
{
	// Don't attempt to send any events to managed code when the entity has been destroyed.
	if(m_bDestroyed)
		return;
	
	HandleEntityEvent(event, GetEntity(), m_pScript);

	switch(event.event)
	{
	case ENTITY_EVENT_RESET:
		Reset(event.nParam[0]==1);
		break;
	case ENTITY_EVENT_DONE:
		m_bDestroyed = true;
		break;
	}
}
Exemplo n.º 2
0
void CMonoActor::ProcessEvent(SEntityEvent& event)
{
	if(m_pScript == nullptr)
		return;

	HandleEntityEvent(event, GetEntity(), m_pScript);

	switch (event.event)
	{
	case ENTITY_EVENT_UNHIDE:
	case ENTITY_EVENT_VISIBLE:
		GetGameObject()->RequestRemoteUpdate(eEA_Physics | eEA_GameClientDynamic | eEA_GameServerDynamic | eEA_GameClientStatic | eEA_GameServerStatic);
		break;
	case ENTITY_EVENT_START_GAME:
		{
			GetGameObject()->RequestRemoteUpdate(eEA_Physics | eEA_GameClientDynamic | eEA_GameServerDynamic | eEA_GameClientStatic | eEA_GameServerStatic);

			if (m_pAnimatedCharacter)
				m_pAnimatedCharacter->ResetState();
		}
		break;
	case ENTITY_EVENT_RESET:
		{
			if (m_pAnimatedCharacter)
				m_pAnimatedCharacter->ResetState();

			GetGameObject()->RequestRemoteUpdate(eEA_Physics | eEA_GameClientDynamic | eEA_GameServerDynamic | eEA_GameClientStatic | eEA_GameServerStatic);
		}
		break;
	case ENTITY_EVENT_INIT:
		{
			if (m_pAnimatedCharacter)
				m_pAnimatedCharacter->ResetState();
		}
		break;
  }  
}