本文整理汇总了C++中CHandle::FadeAndDie方法的典型用法代码示例。如果您正苦于以下问题:C++ CHandle::FadeAndDie方法的具体用法?C++ CHandle::FadeAndDie怎么用?C++ CHandle::FadeAndDie使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHandle
的用法示例。
在下文中一共展示了CHandle::FadeAndDie方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FadeGlow
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CAntlionGrub::FadeGlow( void )
{
if ( m_hGlowSprite )
{
m_hGlowSprite->FadeAndDie( 0.25f );
}
}
示例2: UpdateOnRemove
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CWeaponStriderBuster::UpdateOnRemove( void )
{
DestroyConstraint();
if ( m_hGlowSprite != NULL )
{
m_hGlowSprite->FadeAndDie( 0.5f );
m_hGlowSprite = NULL;
}
if ( m_hParticleEffect )
{
UTIL_Remove( m_hParticleEffect );
}
BaseClass::UpdateOnRemove();
}
示例3: BoltTouch
//.........这里部分代码省略.........
DispatchEffect( "BoltImpact", data );
}
}
SetTouch( NULL );
SetThink( NULL );
UTIL_Remove( this );
}
else
{
trace_t tr;
tr = BaseClass::GetTouchTrace();
// See if we struck the world
if ( pOther->GetMoveType() == MOVETYPE_NONE && !( tr.surface.flags & SURF_SKY ) )
{
EmitSound( "Weapon_Crossbow.BoltHitWorld" );
// if what we hit is static architecture, can stay around for a while.
Vector vecDir = GetAbsVelocity();
float speed = VectorNormalize( vecDir );
// See if we should reflect off this surface
float hitDot = DotProduct( tr.plane.normal, -vecDir );
if ( ( hitDot < 0.5f ) && ( speed > 100 ) )
{
Vector vReflection = 2.0f * tr.plane.normal * hitDot + vecDir;
QAngle reflectAngles;
VectorAngles( vReflection, reflectAngles );
SetLocalAngles( reflectAngles );
SetAbsVelocity( vReflection * speed * 0.75f );
// Start to sink faster
SetGravity( 1.0f );
}
else
{
SetThink( &CCrossbowBolt::SUB_Remove );
SetNextThink( gpGlobals->curtime + 2.0f );
//FIXME: We actually want to stick (with hierarchy) to what we've hit
SetMoveType( MOVETYPE_NONE );
Vector vForward;
AngleVectors( GetAbsAngles(), &vForward );
VectorNormalize ( vForward );
CEffectData data;
data.m_vOrigin = tr.endpos;
data.m_vNormal = vForward;
data.m_nEntIndex = 0;
DispatchEffect( "BoltImpact", data );
UTIL_ImpactTrace( &tr, DMG_BULLET );
AddEffects( EF_NODRAW );
SetTouch( NULL );
SetThink( &CCrossbowBolt::SUB_Remove );
SetNextThink( gpGlobals->curtime + 2.0f );
if ( m_pGlowSprite != NULL )
{
m_pGlowSprite->TurnOn();
m_pGlowSprite->FadeAndDie( 3.0f );
}
}
// Shoot some sparks
if ( UTIL_PointContents( GetAbsOrigin() ) != CONTENTS_WATER)
{
g_pEffects->Sparks( GetAbsOrigin() );
}
}
else
{
// Put a mark unless we've hit the sky
if ( ( tr.surface.flags & SURF_SKY ) == false )
{
UTIL_ImpactTrace( &tr, DMG_BULLET );
}
UTIL_Remove( this );
}
}
if ( g_pGameRules->IsMultiplayer() )
{
// SetThink( &CCrossbowBolt::ExplodeThink );
// SetNextThink( gpGlobals->curtime + 0.1f );
}
}
示例4: BoltTouch
//.........这里部分代码省略.........
SetTouch( NULL );
SetThink( NULL );
if ( !g_pGameRules->IsMultiplayer() )
{
UTIL_Remove( this );
}
}
else
{
trace_t tr;
tr = BaseClass::GetTouchTrace();
// See if we struck the world
if ( pOther->GetMoveType() == MOVETYPE_NONE && !( tr.surface.flags & SURF_SKY ) )
{
EmitSound( "Weapon_Crossbow.BoltHitWorld" );
// if what we hit is static architecture, can stay around for a while.
Vector vecDir = GetAbsVelocity();
float speed = VectorNormalize( vecDir );
// See if we should reflect off this surface
float hitDot = DotProduct( tr.plane.normal, -vecDir );
if ( ( hitDot < 0.5f ) && ( speed > 100 ) )
{
Vector vReflection = 2.0f * tr.plane.normal * hitDot + vecDir;
QAngle reflectAngles;
VectorAngles( vReflection, reflectAngles );
SetLocalAngles( reflectAngles );
SetAbsVelocity( vReflection * speed * 0.75f );
// Start to sink faster
SetGravity( 1.0f );
}
else
{
SetThink( &CCrossbowBolt::SUB_Remove );
SetNextThink( gpGlobals->curtime + 2.0f );
//FIXME: We actually want to stick (with hierarchy) to what we've hit
SetMoveType( MOVETYPE_NONE );
Vector vForward;
AngleVectors( GetAbsAngles(), &vForward );
VectorNormalize ( vForward );
CEffectData data;
data.m_vOrigin = tr.endpos;
data.m_vNormal = vForward;
data.m_nEntIndex = 0;
DispatchEffect( "BoltImpact", data );
UTIL_ImpactTrace( &tr, DMG_BULLET );
AddEffects( EF_NODRAW );
SetTouch( NULL );
SetThink( &CCrossbowBolt::SUB_Remove );
SetNextThink( gpGlobals->curtime + 2.0f );
if ( m_pGlowSprite != NULL )
{
m_pGlowSprite->TurnOn();
m_pGlowSprite->FadeAndDie( 3.0f );
}
}
// Shoot some sparks
if ( UTIL_PointContents( GetAbsOrigin() ) != CONTENTS_WATER)
{
g_pEffects->Sparks( GetAbsOrigin() );
}
}
else
{
// Put a mark unless we've hit the sky
if ( ( tr.surface.flags & SURF_SKY ) == false )
{
UTIL_ImpactTrace( &tr, DMG_BULLET );
}
UTIL_Remove( this );
}
}
if ( g_pGameRules->IsMultiplayer() )
{
// SetThink( &CCrossbowBolt::ExplodeThink );
// SetNextThink( gpGlobals->curtime + 0.1f );
}
}