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


C++ CGameObject::SendEvent方法代码示例

本文整理汇总了C++中CGameObject::SendEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameObject::SendEvent方法的具体用法?C++ CGameObject::SendEvent怎么用?C++ CGameObject::SendEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGameObject的用法示例。


在下文中一共展示了CGameObject::SendEvent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SendEventToGameObject

int CScriptBind_Game::SendEventToGameObject( IFunctionHandler* pH, ScriptHandle entityId, char* event )
{
	IEntity* pEntity = gEnv->pEntitySystem->GetEntity( (EntityId)entityId.n );
	if (pEntity != NULL)
	{
		CGameObject* pGameObject = static_cast<CGameObject*>(pEntity->GetProxy(ENTITY_PROXY_USER));
		if (pGameObject != NULL)
		{
			SGameObjectEvent goEvent( (uint32)eGFE_ScriptEvent, eGOEF_ToExtensions, IGameObjectSystem::InvalidExtensionID, event );
			pGameObject->SendEvent( goEvent );
		}
	}
	return pH->EndFunction();
}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:14,代码来源:ScriptBind_Game.cpp

示例2: NotifyMineEvent

void CMineField::NotifyMineEvent( const EntityId targetEntity, const EMineGameObjectEvent event )
{
	IEntity* pEntity = gEnv->pEntitySystem->GetEntity( targetEntity );
	if (pEntity)
	{
		CGameObject* pGameObject = static_cast<CGameObject*>(pEntity->GetComponent<IComponentUser>().get());
		if (pGameObject != NULL)
		{
			const EntityId thisEntityId = GetEntityId();
			SGameObjectEvent goEvent( (uint32)event, eGOEF_ToExtensions, IGameObjectSystem::InvalidExtensionID, (void*)(&(thisEntityId)) ); // This entity's id is sent as parameter
			pGameObject->SendEvent( goEvent );
		}
	}
}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:14,代码来源:MineField.cpp

示例3: NotifyScreenSharingEvent

void CDoorPanel::NotifyScreenSharingEvent(const EDoorPanelGameObjectEvent event)
{
	if (m_screenSharingEntities.size() > 0)
	{
		const EntityId thisEntityId = GetEntityId();
		for (size_t i = 0; i < m_screenSharingEntities.size(); i++)
		{
			const EntityId entityId = m_screenSharingEntities[i];
			IEntity* pEntity = gEnv->pEntitySystem->GetEntity( entityId );
			if (pEntity)
			{
				CGameObject* pGameObject = static_cast<CGameObject*>(pEntity->GetProxy(ENTITY_PROXY_USER));
				if (pGameObject != NULL)
				{
					SGameObjectEvent goEvent( (uint32)event, eGOEF_ToExtensions, IGameObjectSystem::InvalidExtensionID, (void*)(&(thisEntityId)) );
					pGameObject->SendEvent( goEvent );
				}
			}
		}
	}
}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:21,代码来源:DoorPanel.cpp

示例4: NotifyMineListenersEvent

void CSmartMine::NotifyMineListenersEvent( const EMineEventListenerGameObjectEvent event )
{
	const EntityId thisEntityId = GetEntityId();
	TMineEventListeners::iterator iter = m_mineEventListeners.begin();
	const TMineEventListeners::const_iterator iterEnd = m_mineEventListeners.end();
	while (iter != iterEnd)
	{
		const EntityId entityId = *iter;
		IEntity* pEntity = gEnv->pEntitySystem->GetEntity( entityId );
		if (pEntity)
		{
			CGameObject* pGameObject = static_cast<CGameObject*>(pEntity->GetProxy(ENTITY_PROXY_USER));
			if (pGameObject != NULL)
			{
				SGameObjectEvent goEvent( (uint32)event, eGOEF_ToExtensions, IGameObjectSystem::InvalidExtensionID, (void*)(&(thisEntityId)) ); // This entity's id is sent as parameter
				pGameObject->SendEvent( goEvent );
			}
		}

		++iter;
	}
}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:22,代码来源:SmartMine.cpp


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