public override MyObjectBuilder_EntityBase GetObjectBuilder(bool copy = false) { var builder = (MyObjectBuilder_FloatingObject)base.GetObjectBuilder(copy); builder.Item = Item.GetObjectBuilder(); return(builder); }
private static MyObjectBuilder_Meteor PrepareBuilder(ref MyInventoryItem item) { var meteorBuilder = Sandbox.Common.ObjectBuilders.Serializer.MyObjectBuilderSerializer.CreateNewObject <MyObjectBuilder_Meteor>(); meteorBuilder.Item = item.GetObjectBuilder(); meteorBuilder.PersistentFlags |= MyPersistentEntityFlags2.Enabled | MyPersistentEntityFlags2.InScene; return(meteorBuilder); }
private static MyObjectBuilder_FloatingObject PrepareBuilder(ref MyInventoryItem item) { Debug.Assert(item.Amount > 0, "FloatObject item amount must be > 0"); var floatingBuilder = Sandbox.Common.ObjectBuilders.Serializer.MyObjectBuilderSerializer.CreateNewObject <MyObjectBuilder_FloatingObject>(); floatingBuilder.Item = item.GetObjectBuilder(); floatingBuilder.PersistentFlags |= MyPersistentEntityFlags2.Enabled | MyPersistentEntityFlags2.InScene; return(floatingBuilder); }
public override MyObjectBuilder_EntityBase GetObjectBuilder(bool copy = false) { var builder = (MyObjectBuilder_Meteor)base.GetObjectBuilder(copy); builder.LinearVelocity = Entity.Physics.LinearVelocity; builder.AngularVelocity = Entity.Physics.AngularVelocity; if (GameLogic != null) { builder.Item = Item.GetObjectBuilder(); builder.Integrity = Integrity; } return(builder); }
private static MyObjectBuilder_Meteor PrepareBuilder(ref MyInventoryItem item) { var meteorBuilder = Sandbox.Common.ObjectBuilders.Serializer.MyObjectBuilderSerializer.CreateNewObject<MyObjectBuilder_Meteor>(); meteorBuilder.Item = item.GetObjectBuilder(); meteorBuilder.PersistentFlags |= MyPersistentEntityFlags2.Enabled | MyPersistentEntityFlags2.InScene; return meteorBuilder; }