本文整理汇总了C++中CBaseViewModel::RemoveEffects方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseViewModel::RemoveEffects方法的具体用法?C++ CBaseViewModel::RemoveEffects怎么用?C++ CBaseViewModel::RemoveEffects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseViewModel
的用法示例。
在下文中一共展示了CBaseViewModel::RemoveEffects方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: Weapon_Switch
//-----------------------------------------------------------------------------
// Purpose: Override base class so player can reset autoaim
// Input :
// Output :
//-----------------------------------------------------------------------------
bool CBasePlayer::Weapon_Switch( CBaseCombatWeapon *pWeapon, int viewmodelindex /*=0*/ )
{
CBaseCombatWeapon *pLastWeapon = GetActiveWeapon();
if ( BaseClass::Weapon_Switch( pWeapon, viewmodelindex ))
{
if ( pLastWeapon && Weapon_ShouldSetLast( pLastWeapon, GetActiveWeapon() ) )
{
Weapon_SetLast( pLastWeapon->GetLastWeapon() );
}
CBaseViewModel *pViewModel = GetViewModel( viewmodelindex );
Assert( pViewModel );
if ( pViewModel )
pViewModel->RemoveEffects( EF_NODRAW );
ResetAutoaim( );
return true;
}
return false;
}