本文整理汇总了C++中CBaseViewModel::SetWeaponModel方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseViewModel::SetWeaponModel方法的具体用法?C++ CBaseViewModel::SetWeaponModel怎么用?C++ CBaseViewModel::SetWeaponModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseViewModel
的用法示例。
在下文中一共展示了CBaseViewModel::SetWeaponModel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetViewModel
//-----------------------------------------------------------------------------
// Purpose: Sets HL2 specific defaults.
//-----------------------------------------------------------------------------
void CHL2MP_Player::Spawn(void)
{
m_flNextModelChangeTime = 0.0f;
m_flNextTeamChangeTime = 0.0f;
PickDefaultSpawnTeam();
BaseClass::Spawn();
if ( !IsObserver() )
{
pl.deadflag = false;
RemoveSolidFlags( FSOLID_NOT_SOLID );
RemoveEffects( EF_NODRAW );
GiveDefaultItems();
}
SetNumAnimOverlays( 3 );
ResetAnimation();
m_nRenderFX = kRenderNormal;
m_Local.m_iHideHUD = 0;
AddFlag(FL_ONGROUND); // set the player on the ground at the start of the round.
m_impactEnergyScale = HL2MPPLAYER_PHYSDAMAGE_SCALE;
if ( HL2MPRules()->IsIntermission() )
{
AddFlag( FL_FROZEN );
}
else
{
RemoveFlag( FL_FROZEN );
}
m_iSpawnInterpCounter = (m_iSpawnInterpCounter + 1) % 8;
m_Local.m_bDucked = false;
SetPlayerUnderwater(false);
m_bReady = false;
m_flNextKickAttack = gpGlobals->curtime;
CBaseViewModel *Leg = GetViewModel(1);
Leg->SetWeaponModel("models/weapons/v_kick.mdl", NULL);
}
示例2: SetViewModel
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CWarsWeapon::SetViewModel()
{
CUnitBase *pUnit;
CHL2WarsPlayer *pOwner;
pUnit = GetOwner()->MyUnitPointer();
if ( pUnit )
{
pOwner = pUnit->GetCommander();
if( pOwner )
{
CBaseViewModel *vm = pOwner->GetViewModel( m_nViewModelIndex );
if ( vm == NULL )
return;
Assert( vm->ViewModelIndex() == m_nViewModelIndex );
vm->SetWeaponModel( GetViewModel( m_nViewModelIndex ), this );
}
}
BaseClass::SetViewModel();
}