本文整理汇总了C++中CBaseDoor::Use方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseDoor::Use方法的具体用法?C++ CBaseDoor::Use怎么用?C++ CBaseDoor::Use使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseDoor
的用法示例。
在下文中一共展示了CBaseDoor::Use方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ChainUse
//-----------------------------------------------------------------------------
// Purpose: Passes Use along to certain named doors.
//-----------------------------------------------------------------------------
void CBaseDoor::ChainUse( void )
{
if ( m_isChaining )
return;
CBaseEntity *ent = NULL;
while ( ( ent = gEntList.FindEntityByName( ent, m_ChainTarget, NULL ) ) != NULL )
{
if ( ent == this )
continue;
CBaseDoor *door = dynamic_cast< CBaseDoor * >( ent );
if ( door )
{
door->SetChaining( true );
door->Use( m_hActivator, NULL, USE_TOGGLE, 0.0f ); // only the first param is used
door->SetChaining( false );
}
}
}
示例2: ChainUse
void CBaseDoor :: ChainUse( USE_TYPE useType, float value )
{
// to prevent recursion
if( m_isChaining ) return;
CBaseEntity *pEnt = NULL;
while(( pEnt = UTIL_FindEntityByTargetname( pEnt, STRING( m_iChainTarget ))) != NULL )
{
if( pEnt == this ) continue;
CBaseDoor *pDoor = (CBaseDoor *)pEnt;
if( pDoor )
{
pDoor->SetChaining( true );
pDoor->Use( m_hActivator, this, useType, value );
pDoor->SetChaining( false );
}
}
}