示例#1
0
        public override void Init(StringBuilder hudLabelText, MySmallShip parentObject,
                                  Vector3 position, Vector3 forwardVector, Vector3 upVector,
                                  MyMwcObjectBuilder_SmallShip_Weapon objectBuilder)
        {
            base.Init(hudLabelText, MyModelsEnum.Autocannon_Base, MyMaterialType.METAL, parentObject,
                      position, forwardVector, upVector, objectBuilder);

            m_rotationAngle        = MyMwcUtils.GetRandomRadian();
            m_lastTimeShoot        = MyConstants.FAREST_TIME_IN_PAST;
            m_smokeLastTime        = MyConstants.FAREST_TIME_IN_PAST;
            m_smokesToGenerate     = 0;
            m_cannonMotorEndPlayed = true;
            m_rotationTimeout      = (float)MyAutocanonConstants.ROTATION_TIMEOUT + MyMwcUtils.GetRandomFloat(-500, +500);

            m_barrelMatrix = ModelLod0.Dummies["BARREL_POSITION"].Matrix;
            m_barrel       = new MyAutocannonBarrel();
            m_barrel.Init(null, m_barrelMatrix, this);
        }
示例#2
0
        public override void Init(StringBuilder hudLabelText, MySmallShip parentObject,
            Vector3 position, Vector3 forwardVector, Vector3 upVector,
            MyMwcObjectBuilder_SmallShip_Weapon objectBuilder)
        {
            base.Init(hudLabelText, MyModelsEnum.Autocannon_Base, MyMaterialType.METAL, parentObject, 
                position, forwardVector, upVector, objectBuilder);

            m_rotationAngle = MyMwcUtils.GetRandomRadian();
            m_lastTimeShoot = MyConstants.FAREST_TIME_IN_PAST;
            m_smokeLastTime = MyConstants.FAREST_TIME_IN_PAST;
            m_smokesToGenerate = 0;
            m_cannonMotorEndPlayed = true;
            m_rotationTimeout = (float)MyAutocanonConstants.ROTATION_TIMEOUT + MyMwcUtils.GetRandomFloat(-500, +500);

            m_barrelMatrix = ModelLod0.Dummies["BARREL_POSITION"].Matrix;
            m_barrel = new MyAutocannonBarrel();
            m_barrel.Init(null, m_barrelMatrix, this);
        }