コード例 #1
0
        public MyFracturedPiece()
            : base()
        {
            //EntityId = MyEntityIdentifier.AllocateId();

            //TODO: Synchronize through manager to avoid performance hits
            SyncFlag = true;

            base.PositionComp           = new MyFracturePiecePositionComponent();
            base.Render                 = new MyRenderComponentFracturedPiece();
            base.Render.NeedsDraw       = true;
            base.Render.PersistentFlags = MyPersistentEntityFlags2.Enabled;
            AddDebugRenderComponent(new MyFracturedPieceDebugDraw(this));
            UseDamageSystem = false;
            NeedsUpdate     = MyEntityUpdateEnum.EACH_10TH_FRAME | MyEntityUpdateEnum.EACH_100TH_FRAME;
#if !XB1 // !XB1_SYNC_NOREFLECTION
            SyncType = SyncHelpers.Compose(this);
#else // XB1
            SyncType = new SyncType(new List <SyncBase>());
            m_fallSoundShouldPlay = SyncType.CreateAndAddProp <bool>();
            m_fallSoundString     = SyncType.CreateAndAddProp <string>();
#endif // XB1
            m_fallSoundShouldPlay.Value     = false;
            m_fallSoundString.Value         = "";
            m_fallSoundString.ValueChanged += (x) => SetFallSound();
        }
コード例 #2
0
        public MySyncedBlock()
        {
#if !XB1 // !XB1_SYNC_NOREFLECTION
            SyncType = SyncHelpers.Compose(this);
#else // XB1
            SyncType = new SyncType(new List <SyncBase>());
#endif // XB1
        }
コード例 #3
0
 public MyFloatingObject()
 {
     this.WasRemovedFromWorld   = false;
     this.m_soundEmitter        = new MyEntity3DSoundEmitter(this, false, 1f);
     this.m_lastTimePlayedSound = MySandboxGame.TotalGamePlayTimeInMilliseconds;
     base.Render   = new MyRenderComponentFloatingObject();
     this.SyncType = SyncHelpers.Compose(this, 0);
 }
コード例 #4
0
        public void Append(object obj)
        {
            var num = m_properties.Count;

            SyncHelpers.Compose(obj, m_properties.Count, m_properties);
            for (int i = num; i < m_properties.Count; i++)
            {
                m_properties[i].ValueChanged += m_registeredHandlers;
            }
        }
コード例 #5
0
        public MyTerminalBlock()
        {
            CustomName            = new StringBuilder();
            DetailedInfo          = new StringBuilder();
            CustomInfo            = new StringBuilder();
            CustomNameWithFaction = new StringBuilder();

            SyncType = SyncHelpers.Compose(this);
            SyncType.PropertyChanged += sync => RaisePropertiesChanged();
        }
コード例 #6
0
 public MyAutomaticRifleGun()
 {
     NeedsUpdate      = MyEntityUpdateEnum.EACH_FRAME;
     Render.NeedsDraw = true;
     m_gunBase        = new MyGunBase();
     m_soundEmitter   = new MyEntity3DSoundEmitter(this);
     (PositionComp as MyPositionComponent).WorldPositionChanged = WorldPositionChanged;
     this.Render = new MyRenderComponentAutomaticRifle();
     SyncType    = SyncHelpers.Compose(this);
     SyncType.Append(m_gunBase);
 }
コード例 #7
0
        public MyFloatingObject()
        {
            WasRemovedFromWorld   = false;
            m_soundEmitter        = new MyEntity3DSoundEmitter(this);
            m_lastTimePlayedSound = MySandboxGame.TotalGamePlayTimeInMilliseconds;
            Render = new Components.MyRenderComponentFloatingObject();

            SyncType = SyncHelpers.Compose(this);

            Amount.ValueChanged += (x) => { Item.Amount = Amount.Value; UpdateInternalState(); };
        }
コード例 #8
0
        public void Append(object obj)
        {
#if !UNSHAPER_TMP
            //++m_TotalCount;
            //System.Diagnostics.Debug.Print(m_TotalCount.ToString());

            var num = m_properties.Count;
            SyncHelpers.Compose(obj, m_properties.Count, m_properties);
            for (int i = num; i < m_properties.Count; i++)
            {
                m_properties[i].ValueChanged += m_registeredHandlers;
            }
#endif
        }
コード例 #9
0
ファイル: MyFloatingObject.cs プロジェクト: feiyuren233/vrage
        public MyFloatingObject()
        {
            WasRemovedFromWorld   = false;
            m_soundEmitter        = new MyEntity3DSoundEmitter(this);
            m_lastTimePlayedSound = MySandboxGame.TotalGamePlayTimeInMilliseconds;
            Render = new Components.MyRenderComponentFloatingObject();

#if !XB1 // !XB1_SYNC_NOREFLECTION
            SyncType = SyncHelpers.Compose(this);
#else // XB1
            SyncType = new SyncType(new List <SyncBase>());
            Amount   = SyncType.CreateAndAddProp <MyFixedPoint>();
#endif // XB1

            Amount.ValueChanged += (x) => { Item.Amount = Amount.Value; UpdateInternalState(); };
        }
コード例 #10
0
        public MyAutomaticRifleGun()
        {
            NeedsUpdate      = MyEntityUpdateEnum.EACH_FRAME;
            Render.NeedsDraw = true;
#if XB1 // XB1_SYNC_NOREFLECTION
            SyncType  = new SyncType(new List <SyncBase>());
            m_gunBase = new MyGunBase(SyncType);
#else // !XB1
            m_gunBase = new MyGunBase();
#endif // !XB1
            m_soundEmitter = new MyEntity3DSoundEmitter(this);
            (PositionComp as MyPositionComponent).WorldPositionChanged = WorldPositionChanged;
            this.Render = new MyRenderComponentAutomaticRifle();
#if !XB1 // !XB1_SYNC_NOREFLECTION
            SyncType = SyncHelpers.Compose(this);
            SyncType.Append(m_gunBase);
#endif // !XB1
        }
コード例 #11
0
        public MyFracturedPiece()
            : base()
        {
            //EntityId = MyEntityIdentifier.AllocateId();

            //TODO: Synchronize through manager to avoid performance hits
            SyncFlag = true;

            base.PositionComp           = new MyFracturePiecePositionComponent();
            base.Render                 = new MyRenderComponentFracturedPiece();
            base.Render.NeedsDraw       = true;
            base.Render.PersistentFlags = MyPersistentEntityFlags2.Enabled;
            AddDebugRenderComponent(new MyFracturedPieceDebugDraw(this));
            UseDamageSystem                 = false;
            NeedsUpdate                     = MyEntityUpdateEnum.EACH_10TH_FRAME;
            SyncType                        = SyncHelpers.Compose(this);
            m_fallSoundShouldPlay.Value     = false;
            m_fallSoundString.Value         = "";
            m_fallSoundString.ValueChanged += (x) => SetFallSound();
        }
コード例 #12
0
 public MySyncedBlock()
 {
     SyncType = SyncHelpers.Compose(this);
 }
コード例 #13
0
 public MySyncedBlock()
 {
     this.SyncType = SyncHelpers.Compose(this, 0);
 }