当前位置: 首页>>代码示例>>C++>>正文


C++ EHANDLE::Spawn方法代码示例

本文整理汇总了C++中EHANDLE::Spawn方法的典型用法代码示例。如果您正苦于以下问题:C++ EHANDLE::Spawn方法的具体用法?C++ EHANDLE::Spawn怎么用?C++ EHANDLE::Spawn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EHANDLE的用法示例。


在下文中一共展示了EHANDLE::Spawn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Spawn

//------------------------------------------------------------------------------
// Purpose :
// Input   :
// Output  :
//------------------------------------------------------------------------------
void CNPC_CombineDropship::Spawn( void )
{
    Precache( );

    SetModel( "models/combine_dropship.mdl" );
    BaseClass::Spawn();

    ExtractBbox( SelectHeaviestSequence( ACT_DROPSHIP_DEPLOY_IDLE ), m_cullBoxMins, m_cullBoxMaxs ); 
    BaseClass::Spawn();

    InitPathingData( DROPSHIP_LEAD_DISTANCE, DROPSHIP_MIN_CHASE_DIST_DIFF, DROPSHIP_AVOID_DIST );

    // create the correct bin for the ship to carry
    switch ( m_iCrateType )
    {
    case CRATE_ROLLER_HOPPER:
        break;
    case CRATE_SOLDIER:
        m_hContainer = CreateEntityByName( "prop_dynamic" );
        if ( m_hContainer )
        {
            m_hContainer->SetModel( "models/props_junk/trashdumpster02.mdl" );
            m_hContainer->SetLocalOrigin( GetAbsOrigin() );
            m_hContainer->SetLocalAngles( GetLocalAngles() );
            m_hContainer->SetAbsAngles( GetAbsAngles() );
            m_hContainer->SetParent(this, 0);
            m_hContainer->SetOwnerEntity(this);
            m_hContainer->SetSolid( SOLID_VPHYSICS );
            m_hContainer->Spawn();
        }
        break;

    case CRATE_NONE:
    default:
        break;
    }

    m_iHealth = 100;
    m_flFieldOfView = 0.5; // 60 degrees
    m_iContainerMoveType = MOVETYPE_NONE;

    //InitBoneControllers();
    InitCustomSchedules();

    if ( m_hContainer )
    {
        SetIdealActivity( (Activity)ACT_DROPSHIP_FLY_IDLE_CARGO );
    }
    else
    {
        SetIdealActivity( (Activity)ACT_DROPSHIP_FLY_IDLE_EXAGG );
    }

    m_flMaxSpeed = DROPSHIP_MAX_SPEED;
    m_flMaxSpeedFiring = BASECHOPPER_MAX_FIRING_SPEED;
    m_hPickupTarget = NULL;

    //!!!HACKHACK
    // This tricks the AI code that constantly complains that the vehicle has no schedule.
    SetSchedule( SCHED_IDLE_STAND );

    m_iLandState = LANDING_NO;
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:68,代码来源:npc_combinedropship.cpp


注:本文中的EHANDLE::Spawn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。