// Add new ship to the list public static MySmallShip Add(string displayName, MyMwcObjectBuilder_Ship objectBuilder) { MySmallShip newShip = m_hologramShips.Allocate(); if (newShip != null) { newShip.Init(displayName, objectBuilder); if (newShip.Physics.Enabled) { newShip.Physics.Enabled = false; } /* * newShip.Physics.Type = MyConstants.RIGIDBODY_TYPE_DEFAULT; * newShip.Physics.CollisionLayer = MyConstants.COLLISION_LAYER_UNCOLLIDABLE; */ newShip.IsHologram = true; // we dont want the hologram to have a light newShip.RemoveLight(); newShip.RemoveSubObjectLights(); newShip.Config.Engine.Level = 1; newShip.Config.ReflectorLight.Level = 1; newShip.GetReflectorProperties().CurrentBillboardLength = 40; newShip.GetReflectorProperties().CurrentBillboardThickness = 6; newShip.CastShadows = false; } return(newShip); }
public virtual void Init(string hudLabelText, MyMwcObjectBuilder_Ship shipObjectBuilder) { Debug.Assert(shipObjectBuilder != null); this.Faction = shipObjectBuilder.Faction; if (shipObjectBuilder.Inventory != null) { Inventory.Init(shipObjectBuilder.Inventory); } else { OnInventoryContentChange(Inventory); } }