本文整理汇总了C++中CHandle::AddSpawnFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ CHandle::AddSpawnFlags方法的具体用法?C++ CHandle::AddSpawnFlags怎么用?C++ CHandle::AddSpawnFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHandle
的用法示例。
在下文中一共展示了CHandle::AddSpawnFlags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateEffect
void CWeaponEgon::CreateEffect( void )
{
#ifndef CLIENT_DLL
CBasePlayer *pPlayer = ToBasePlayer( GetOwner() );
if ( !pPlayer )
{
return;
}
DestroyEffect();
m_hBeam = CBeam::BeamCreate( EGON_BEAM_SPRITE, 3.5 );
m_hBeam->PointEntInit( GetAbsOrigin(), this );
m_hBeam->SetBeamFlags( FBEAM_SINENOISE );
m_hBeam->SetEndAttachment( 1 );
m_hBeam->AddSpawnFlags( SF_BEAM_TEMPORARY ); // Flag these to be destroyed on save/restore or level transition
m_hBeam->SetOwnerEntity( pPlayer );
m_hBeam->SetScrollRate( 10 );
m_hBeam->SetBrightness( 200 );
m_hBeam->SetColor( 50, 50, 255 );
m_hBeam->SetNoise( 0.2 );
m_hNoise = CBeam::BeamCreate( EGON_BEAM_SPRITE, 5.0 );
m_hNoise->PointEntInit( GetAbsOrigin(), this );
m_hNoise->SetEndAttachment( 1 );
m_hNoise->AddSpawnFlags( SF_BEAM_TEMPORARY );
m_hNoise->SetOwnerEntity( pPlayer );
m_hNoise->SetScrollRate( 25 );
m_hNoise->SetBrightness( 200 );
m_hNoise->SetColor( 50, 50, 255 );
m_hNoise->SetNoise( 0.8 );
m_hSprite = CSprite::SpriteCreate( EGON_FLARE_SPRITE, GetAbsOrigin(), false );
m_hSprite->SetScale( 1.0 );
m_hSprite->SetTransparency( kRenderGlow, 255, 255, 255, 255, kRenderFxNoDissipation );
m_hSprite->AddSpawnFlags( SF_SPRITE_TEMPORARY );
m_hSprite->SetOwnerEntity( pPlayer );
#endif
}
示例2: SpotlightCreate
//------------------------------------------------------------------------------
// Purpose :
// Input :
// Output :
//------------------------------------------------------------------------------
void CPointSpotlight::SpotlightCreate(void)
{
if ( m_hSpotlightTarget.Get() != NULL )
return;
AngleVectors( GetAbsAngles(), &m_vSpotlightDir );
trace_t tr;
UTIL_TraceLine( GetAbsOrigin(), GetAbsOrigin() + m_vSpotlightDir * m_flSpotlightMaxLength, MASK_SOLID_BRUSHONLY, this, COLLISION_GROUP_NONE, &tr);
m_hSpotlightTarget = (CSpotlightEnd*)CreateEntityByName( "spotlight_end" );
m_hSpotlightTarget->Spawn();
m_hSpotlightTarget->SetAbsOrigin( tr.endpos );
m_hSpotlightTarget->SetOwnerEntity( this );
m_hSpotlightTarget->m_clrRender = m_clrRender;
m_hSpotlightTarget->m_Radius = m_flSpotlightMaxLength;
if ( FBitSet (m_spawnflags, SF_SPOTLIGHT_NO_DYNAMIC_LIGHT) )
{
m_hSpotlightTarget->m_flLightScale = 0.0;
}
//m_hSpotlight = CBeam::BeamCreate( "sprites/spotlight.vmt", m_flSpotlightGoalWidth );
m_hSpotlight = CBeam::BeamCreate( "sprites/glow_test02.vmt", m_flSpotlightGoalWidth );
// Set the temporary spawnflag on the beam so it doesn't save (we'll recreate it on restore)
m_hSpotlight->SetHDRColorScale( m_flHDRColorScale );
m_hSpotlight->AddSpawnFlags( SF_BEAM_TEMPORARY );
m_hSpotlight->SetColor( m_clrRender->r, m_clrRender->g, m_clrRender->b );
m_hSpotlight->SetHaloTexture(m_nHaloSprite);
m_hSpotlight->SetHaloScale(60);
m_hSpotlight->SetEndWidth(m_flSpotlightGoalWidth);
m_hSpotlight->SetBeamFlags( (FBEAM_SHADEOUT|FBEAM_NOTILE) );
m_hSpotlight->SetBrightness( 64 );
m_hSpotlight->SetNoise( 0 );
m_hSpotlight->SetMinDXLevel( m_nMinDXLevel );
if ( m_bEfficientSpotlight )
{
m_hSpotlight->PointsInit( GetAbsOrigin(), m_hSpotlightTarget->GetAbsOrigin() );
}
else
{
m_hSpotlight->EntsInit( this, m_hSpotlightTarget );
}
}