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


C++ CSprite::FadeOutFromSpawn方法代码示例

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


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

示例1: DoLoadEffect

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CWeaponCrossbow::DoLoadEffect( void )
{
	SetSkin( BOLT_SKIN_GLOW );

	CBasePlayer *pOwner = ToBasePlayer( GetOwner() );

	if ( pOwner == NULL )
		return;

	CBaseViewModel *pViewModel = pOwner->GetViewModel();

	if ( pViewModel == NULL )
		return;

	CEffectData	data;

	data.m_nEntIndex = pViewModel->entindex();
	data.m_nAttachmentIndex = 1;

	DispatchEffect( "CrossbowLoad", data );

	CSprite *pBlast = CSprite::SpriteCreate( CROSSBOW_GLOW_SPRITE2, GetAbsOrigin(), false );

	if ( pBlast )
	{
		pBlast->SetAttachment( pOwner->GetViewModel(), 1 );
		pBlast->SetTransparency( kRenderTransAdd, 255, 255, 255, 255, kRenderFxNone );
		pBlast->SetBrightness( 128 );
		pBlast->SetScale( 0.2f );
		pBlast->FadeOutFromSpawn();
	}
}
开发者ID:SCell555,项目名称:source-sdk-2013,代码行数:35,代码来源:weapon_crossbow.cpp

示例2: DoLoadEffect

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CWeaponCrossbow::DoLoadEffect()
{
	SetSkin(BOLT_SKIN_GLOW);

	CBasePlayer *pOwner = ToBasePlayer( GetOwner() );

	if ( !pOwner )
		return;

	CEffectData	data;
	data.m_nAttachmentIndex = 1;

#ifdef GAME_DLL

	data.m_nEntIndex = entindex();

	CPASFilter filter(data.m_vOrigin);
	filter.RemoveRecipient(pOwner);
	te->DispatchEffect(filter, 0.0, data.m_vOrigin, "CrossbowLoad", data);

#else

	CBaseViewModel *pViewModel = pOwner->GetViewModel();

	if ( pViewModel != NULL )
	{
		if ( ::input->CAM_IsThirdPerson() )
			data.m_hEntity = pViewModel->GetRefEHandle();
		else
			data.m_hEntity = GetRefEHandle();

		DispatchEffect("CrossbowLoad", data);
	}

#endif

	//Tony; switched this up, always attach it to the weapon, not the view model!!
#ifndef CLIENT_DLL
	CSprite *pBlast = CSprite::SpriteCreate( CROSSBOW_GLOW_SPRITE2, GetAbsOrigin(), false );

	if ( pBlast )
	{
		pBlast->SetAttachment(this, 1);
		pBlast->SetTransparency(kRenderTransAdd, 255, 255, 255, 255, kRenderFxNone );
		pBlast->SetBrightness(128);
		pBlast->SetScale(0.2f);
		pBlast->FadeOutFromSpawn();
	}
#endif
}
开发者ID:InfoSmart,项目名称:InSource-Singleplayer,代码行数:53,代码来源:weapon_crossbow.cpp

示例3: DoLoadEffect

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CWeaponCrossbow::DoLoadEffect( void )
{
	SetSkin( BOLT_SKIN_GLOW );

	CBasePlayer *pOwner = ToBasePlayer( GetOwner() );

	if ( pOwner == NULL )
		return;

	//Tony; change this up a bit; on the server, dispatch an effect but don't send it to the client who fires
	//on the client, create an effect either in the view model, or on the world model if first person.
	CEffectData	data;

	data.m_nAttachmentIndex = 1;
	data.m_vOrigin = pOwner->GetAbsOrigin();

	CPASFilter filter( data.m_vOrigin );

#ifdef GAME_DLL
	filter.RemoveRecipient( pOwner );
	data.m_nEntIndex = entindex();
#else
	CBaseViewModel *pViewModel = pOwner->GetViewModel();
	if ( ShouldDrawUsingViewModel() && pViewModel != NULL )
		data.m_hEntity = pViewModel->GetRefEHandle();
	else
		data.m_hEntity = GetRefEHandle();
#endif

	DispatchEffect( "CrossbowLoad", data, filter );

#ifndef CLIENT_DLL
	CSprite *pBlast = CSprite::SpriteCreate( CROSSBOW_GLOW_SPRITE2, GetAbsOrigin(), false );

	if ( pBlast )
	{
		pBlast->SetAttachment( this, 1 );
		pBlast->SetTransparency( kRenderTransAdd, 255, 255, 255, 255, kRenderFxNone );
		pBlast->SetBrightness( 128 );
		pBlast->SetScale( 0.2f );
		pBlast->FadeOutFromSpawn();
	}
#endif
	
}
开发者ID:hlstriker,项目名称:source-sdk-2013,代码行数:48,代码来源:weapon_crossbow.cpp


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