本文整理汇总了C++中CSprite::FadeAndDie方法的典型用法代码示例。如果您正苦于以下问题:C++ CSprite::FadeAndDie方法的具体用法?C++ CSprite::FadeAndDie怎么用?C++ CSprite::FadeAndDie使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSprite
的用法示例。
在下文中一共展示了CSprite::FadeAndDie方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DieThink
void CGib::DieThink ( void )
{
if ( GetSprite() )
{
CSprite *pSprite = dynamic_cast<CSprite*>( GetSprite() );
if ( pSprite )
{
pSprite->FadeAndDie( 0.0 );
}
}
if ( GetFlame() )
{
CEntityFlame *pFlame = dynamic_cast< CEntityFlame*>( GetFlame() );
if ( pFlame )
{
pFlame->SetLifetime( 1.0f );
}
}
if ( g_pGameRules->IsMultiplayer() )
{
UTIL_Remove( this );
}
else
{
SetThink ( &CGib::SUB_FadeOut );
SetNextThink( gpGlobals->curtime );
}
}
示例2: WaitTillLand
//=========================================================
// WaitTillLand - in order to emit their meaty scent from
// the proper location, gibs should wait until they stop
// bouncing to emit their scent. That's what this function
// does.
//=========================================================
void CGib::WaitTillLand ( void )
{
if (!IsInWorld())
{
UTIL_Remove( this );
return;
}
if ( GetAbsVelocity() == vec3_origin )
{
SetRenderAlpha( 255 );
m_nRenderMode = kRenderTransTexture;
if ( GetMoveType() != MOVETYPE_VPHYSICS )
{
AddSolidFlags( FSOLID_NOT_SOLID );
}
SetLocalAngularVelocity( vec3_angle );
SetNextThink( gpGlobals->curtime + m_lifeTime );
SetThink ( &CGib::SUB_FadeOut );
if ( GetSprite() )
{
CSprite *pSprite = dynamic_cast<CSprite*>( GetSprite() );
if ( pSprite )
{
//Adrian - Why am I doing this? Check InitPointGib for the answer!
if ( m_lifeTime == 0 )
m_lifeTime = random->RandomFloat( 1, 3 );
pSprite->FadeAndDie( m_lifeTime );
}
}
if ( GetFlame() )
{
CEntityFlame *pFlame = dynamic_cast< CEntityFlame*>( GetFlame() );
if ( pFlame )
{
pFlame->SetLifetime( 1.0f );
}
}
// If you bleed, you stink!
if ( m_bloodColor != DONT_BLEED )
{
// ok, start stinkin!
// FIXME: It's too easy to fill up the sound queue with all these meat sounds
// CSoundEnt::InsertSound ( SOUND_MEAT, GetAbsOrigin(), 384, 25 );
}
}
else
{
// wait and check again in another half second.
SetNextThink( gpGlobals->curtime + 0.5f );
}
}
示例3: Event_Killed
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CNPC_AntlionGrub::Event_Killed( const CTakeDamageInfo &info )
{
BaseClass::Event_Killed( info );
if ( ( m_bSquashed == false ) && ( info.GetDamageType() & DMG_CLUB ) )
{
// Die!
Squash( info.GetAttacker() );
}
else
{
//Restore this touch so we can still be squished
SetTouch( GrubTouch );
}
// Slowly fade out glow out
m_pGlowSprite->FadeAndDie( 5.0f );
}