public override MyObjectBuilder_ComponentBase Serialize(bool copy = false) { MyObjectBuilder_TimerComponent component1 = MyComponentFactory.CreateObjectBuilder(this) as MyObjectBuilder_TimerComponent; component1.Repeat = this.Repeat; component1.TimeToEvent = this.TimeToEvent; component1.SetTimeMinutes = this.m_setTimeMin; component1.TimerEnabled = this.TimerEnabled; component1.RemoveEntityOnTimer = this.RemoveEntityOnTimer; return(component1); }
public override void Deserialize(MyObjectBuilder_ComponentBase baseBuilder) { MyObjectBuilder_TimerComponent component = baseBuilder as MyObjectBuilder_TimerComponent; this.Repeat = component.Repeat; this.TimeToEvent = component.TimeToEvent; this.m_setTimeMin = component.SetTimeMinutes; this.TimerEnabled = component.TimerEnabled; this.RemoveEntityOnTimer = component.RemoveEntityOnTimer; if (this.RemoveEntityOnTimer && Sync.IsServer) { this.EventToTrigger = GetRemoveEntityOnTimerEvent(); } }