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


C++ IActor::GetActorClass方法代码示例

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


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

示例1:

CPlayer *CScriptBind_HitDeathReactions::GetAssociatedActor(IFunctionHandler *pH) const
{
	SmartScriptTable selfTable;
	pH->GetSelf(selfTable);
	CRY_ASSERT(selfTable->HaveValue("__actor"));
	ScriptHandle actorEntityId;
	selfTable->GetValue("__actor", actorEntityId);
	IActor *pActor = m_pGameFW->GetIActorSystem()->GetActor(static_cast<EntityId>(actorEntityId.n));
	// [*DavidR | 13/Nov/2009] WARNING: This downcast could be dangerous if CHitDeathReactions is moved to
	// CActor classes
	CRY_ASSERT(pActor && (pActor->GetActorClass() == CPlayer::GetActorClassType()));
	return static_cast<CPlayer *>(pActor);
}
开发者ID:Oliverreason,项目名称:bare-minimum-cryengine3,代码行数:13,代码来源:ScriptBind_HitDeathReactions.cpp

示例2: ProcessLocalHit

void CGameRules::ProcessLocalHit( const HitInfo& hitInfo, float fCausedDamage /*= 0.0f*/ )
{
		//Place the code that should be invoked in both server and client sides here
		IActor* pActor = g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(hitInfo.targetId);
		if (pActor != NULL && (pActor->GetActorClass() == CPlayer::GetActorClassType()))
		{

				// Clients sometimes want to force a hit death reaction to play (when the victim isnt actually dead.. but will be when the server responds to a hit req)
				CHitDeathReactionsPtr pHitDeathReactions = static_cast<CPlayer*>(pActor)->GetHitDeathReactions();
				if (pHitDeathReactions)
				{
						// If the user has requested the player be force killed, then we need to *react* like this was a kill
						if(hitInfo.forceLocalKill)
						{
								// Force the hit death reaction to react as if was a kill 
								CActor::KillParams params;
								params.shooterId					= hitInfo.shooterId;
								params.targetId						= hitInfo.targetId;
								params.weaponId						= hitInfo.weaponId;
								params.projectileId				= hitInfo.projectileId;
								params.itemIdToDrop				= -1;
								params.weaponClassId			= hitInfo.weaponClassId;
								params.damage							= hitInfo.damage;
								params.material						= -1;
								params.hit_type						= hitInfo.type;
								params.hit_joint					= hitInfo.partId;
								params.projectileClassId	= hitInfo.projectileClassId;
								params.penetration				= hitInfo.penetrationCount;
								params.firstKill					= false;
								params.killViaProxy				= hitInfo.hitViaProxy;
								params.impulseScale				= hitInfo.impulseScale; 
								params.forceLocalKill			= hitInfo.forceLocalKill; 

								pHitDeathReactions->OnKill(params);
						}
						else
						{
								// Proceed as normal
								pHitDeathReactions->OnHit(hitInfo, fCausedDamage);
						}
				}
		}
}
开发者ID:jjiezheng,项目名称:oohh,代码行数:43,代码来源:GameRulesClientServer.cpp


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