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(); }
public MySyncedBlock() { #if !XB1 // !XB1_SYNC_NOREFLECTION SyncType = SyncHelpers.Compose(this); #else // XB1 SyncType = new SyncType(new List <SyncBase>()); #endif // XB1 }
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); }
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; } }
public MyTerminalBlock() { CustomName = new StringBuilder(); DetailedInfo = new StringBuilder(); CustomInfo = new StringBuilder(); CustomNameWithFaction = new StringBuilder(); SyncType = SyncHelpers.Compose(this); SyncType.PropertyChanged += sync => RaisePropertiesChanged(); }
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); }
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(); }; }
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 }
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(); }; }
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 }
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(); }
public MySyncedBlock() { SyncType = SyncHelpers.Compose(this); }
public MySyncedBlock() { this.SyncType = SyncHelpers.Compose(this, 0); }