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 MyPhysicalInventoryItem item) { var meteorBuilder = MyObjectBuilderSerializer.CreateNewObject <MyObjectBuilder_Meteor>(); meteorBuilder.Item = item.GetObjectBuilder(); meteorBuilder.PersistentFlags |= MyPersistentEntityFlags2.Enabled | MyPersistentEntityFlags2.InScene; return(meteorBuilder); }
private static MyObjectBuilder_FloatingObject PrepareBuilder(ref MyPhysicalInventoryItem item) { Debug.Assert(item.Amount > 0, "FloatObject item amount must be > 0"); var floatingBuilder = 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_FloatingObject PrepareBuilder(ref MyPhysicalInventoryItem item) { MyObjectBuilder_FloatingObject local1 = MyObjectBuilderSerializer.CreateNewObject <MyObjectBuilder_FloatingObject>(); local1.Item = item.GetObjectBuilder(); MyPhysicalItemDefinition physicalItemDefinition = MyDefinitionManager.Static.GetPhysicalItemDefinition(item.Content); local1.ModelVariant = physicalItemDefinition.HasModelVariants ? MyUtils.GetRandomInt(physicalItemDefinition.Models.Length) : 0; MyObjectBuilder_FloatingObject local2 = local1; local2.PersistentFlags |= MyPersistentEntityFlags2.InScene | MyPersistentEntityFlags2.Enabled; return(local2); }
private static MyObjectBuilder_FloatingObject PrepareBuilder(ref MyPhysicalInventoryItem item) { Debug.Assert(item.Amount > 0, "FloatObject item amount must be > 0"); Debug.Assert(item.Scale > 0, "FloatObject item scale must be > 0"); var floatingBuilder = MyObjectBuilderSerializer.CreateNewObject <MyObjectBuilder_FloatingObject>(); floatingBuilder.Item = item.GetObjectBuilder(); var itemDefinition = MyDefinitionManager.Static.GetPhysicalItemDefinition(item.Content); floatingBuilder.ModelVariant = itemDefinition.HasModelVariants ? MyUtils.GetRandomInt(itemDefinition.Models.Length) : 0; floatingBuilder.PersistentFlags |= MyPersistentEntityFlags2.Enabled | MyPersistentEntityFlags2.InScene; return(floatingBuilder); }
protected void RemoveOperatingItem(MyPhysicalInventoryItem item, MyFixedPoint amount) { MyMultiplayer.RaiseEvent(this, x => x.RemoveOperatingItem_Request, item.GetObjectBuilder(), amount, m_lockedByEntityId); }
public void RemoveOperatingItem(MyPhysicalInventoryItem item, MyFixedPoint amount, long senderEntityId) { MyMultiplayer.RaiseEvent(this, x => x.RemoveOperatingItem_Request, item.GetObjectBuilder(), amount, senderEntityId); }
public void InsertOperatingItem(MyPhysicalInventoryItem item, long senderEntityId) { MyMultiplayer.RaiseEvent(this, x => x.InsertOperatingItem_Request, item.GetObjectBuilder(), senderEntityId); }
private static MyObjectBuilder_Meteor PrepareBuilder(ref MyPhysicalInventoryItem item) { var meteorBuilder = MyObjectBuilderSerializer.CreateNewObject<MyObjectBuilder_Meteor>(); meteorBuilder.Item = item.GetObjectBuilder(); meteorBuilder.PersistentFlags |= MyPersistentEntityFlags2.Enabled | MyPersistentEntityFlags2.InScene; return meteorBuilder; }