本文整理汇总了C++中CBaseViewModel::AddEffects方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseViewModel::AddEffects方法的具体用法?C++ CBaseViewModel::AddEffects怎么用?C++ CBaseViewModel::AddEffects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseViewModel
的用法示例。
在下文中一共展示了CBaseViewModel::AddEffects方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetWeaponVisible
//-----------------------------------------------------------------------------
// Purpose: Show/hide weapon and corresponding view model if any
// Input : visible -
//-----------------------------------------------------------------------------
void CTFWeaponInvis::SetWeaponVisible( bool visible )
{
CBaseViewModel *vm = NULL;
CBasePlayer *pOwner = ToBasePlayer( GetOwner() );
if ( pOwner )
{
vm = pOwner->GetViewModel( m_nViewModelIndex );
}
if ( visible )
{
RemoveEffects( EF_NODRAW );
if ( vm )
{
vm->RemoveEffects( EF_NODRAW );
}
}
else
{
AddEffects( EF_NODRAW );
if ( vm )
{
vm->AddEffects( EF_NODRAW );
}
}
}
示例2: SetWeaponVisible
//-----------------------------------------------------------------------------
// Purpose: Show/hide weapon and corresponding view model if any
// Input : visible -
//-----------------------------------------------------------------------------
void CWarsWeapon::SetWeaponVisible( bool visible )
{
CBaseViewModel *vm = NULL;
CUnitBase *pUnit;
if( GetOwner() )
{
pUnit = GetOwner()->MyUnitPointer();
if( pUnit && pUnit->GetCommander() )
{
CBasePlayer *pOwner = ToBasePlayer( pUnit->GetCommander() );
if ( pOwner )
{
vm = pOwner->GetViewModel( m_nViewModelIndex );
}
}
}
if ( vm )
{
if ( visible )
{
vm->RemoveEffects( EF_NODRAW );
}
else
{
vm->AddEffects( EF_NODRAW );
}
}
BaseClass::SetWeaponVisible( visible );
}
示例3: CreateHands
void CEntHost::CreateHands( int index, int parent )
{
Assert( IsPlayer() );
Assert( index >= 1 && index < MAX_VIEWMODELS );
if ( !IsPlayer() )
return;
if ( !GetPlayer()->GetViewModel( parent ) )
return;
if ( !GetHandsModel( index ) )
return;
CBaseViewModel *hands = GetPlayer()->GetViewModel( index );
CBaseViewModel *vm = GetPlayer()->GetViewModel( parent );
// Ya existe, actualizamos el modelo
if ( hands ) {
hands->SetModel( GetHandsModel( index ) );
return;
}
hands = (CBaseViewModel *)CreateEntityByName( "predicted_viewmodel" );
if ( hands ) {
hands->SetAbsOrigin( GetAbsOrigin() );
hands->SetOwner( GetPlayer() );
hands->SetIndex( index );
DispatchSpawn( hands );
hands->SetModel( GetHandsModel( index ) );
hands->SetOwnerViewModel( vm );
hands->SetOwnerEntity( GetPlayer() );
hands->AddEffects( EF_NODRAW );
GetPlayer()->m_hViewModel.Set( index, hands );
}
}
示例4: GetPlayerOwner
void CC4::UpdateShieldState( void )
{
//ADRIANTODO
CCSPlayer *pPlayer = GetPlayerOwner();
if ( !pPlayer )
return;
if ( pPlayer->HasShield() )
{
pPlayer->SetShieldDrawnState( false );
CBaseViewModel *pVM = pPlayer->GetViewModel( 1 );
if ( pVM )
{
pVM->AddEffects( EF_NODRAW );
}
//pPlayer->SetHitBoxSet( 3 );
}
else
BaseClass::UpdateShieldState();
}