Esempio n. 1
0
        public MySmallGatlingGun()
        {
#if XB1 // XB1_SYNC_NOREFLECTION
            m_useConveyorSystem = SyncType.CreateAndAddProp <bool>();
#endif // XB1
            CreateTerminalControls();

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

            m_soundEmitter = new MyEntity3DSoundEmitter(this, true);

#if XB1// XB1_SYNC_NOREFLECTION
            m_gunBase = new MyGunBase(SyncType);
#else // !XB1
            m_gunBase = new MyGunBase();
#endif // !XB1

            NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME | MyEntityUpdateEnum.EACH_10TH_FRAME;
            Render.NeedsDrawFromParent = true;

            Render = new MyRenderComponentSmallGatlingGun();
            AddDebugRenderComponent(new MyDebugRenderComponentSmallGatlingGun(this));

#if !XB1 // !XB1_SYNC_NOREFLECTION
            SyncType.Append(m_gunBase);
#endif // !XB1
        }
        public MySmallGatlingGun()
        {
            m_rotationAngle        = MyUtils.GetRandomRadian();
            m_lastTimeShoot        = MyConstants.FAREST_TIME_IN_PAST;
            m_smokeLastTime        = MyConstants.FAREST_TIME_IN_PAST;
            m_smokesToGenerate     = 0;
            m_cannonMotorEndPlayed = true;
            m_rotationTimeout      = (float)MyGatlingConstants.ROTATION_TIMEOUT + MyUtils.GetRandomFloat(-500, +500);

            m_soundEmitter = new MyEntity3DSoundEmitter(this);

            m_gunBase = new MyGunBase();

            NeedsUpdate = MyEntityUpdateEnum.EACH_FRAME | MyEntityUpdateEnum.EACH_10TH_FRAME;
            Render.NeedsDrawFromParent = true;

            Render = new MyRenderComponentSmallGatlingGun();
            AddDebugRenderComponent(new MyDebugRenderComponentSmallGatlingGun(this));
        }