public void Add(Vector2 hardPoint, HardPointType type) { string dataAsset = type == HardPointType.Engine ? "Sprites\\UI\\InGameUI\\EngineHardPointUI" : "Sprites\\UI\\InGameUI\\HardPointUI"; HardPointUI hardPointUI = new HardPointUI(Parent, hardPoint, dataAsset); if (type == HardPointType.Engine) { EngineHardPointUI.Add(hardPointUI); } else { OtherHardPointUI.Add(hardPointUI); } }
public void Disable(Vector2 hardPoint, HardPointType type) { if (type == HardPointType.Engine) { HardPointUI hardPointUI = EngineHardPointUI.Find(x => x.HardPoint == hardPoint); hardPointUI.Active = false; hardPointUI.Visible = false; } else { HardPointUI hardPointUI = OtherHardPointUI.Find(x => x.HardPoint == hardPoint); hardPointUI.Active = false; hardPointUI.Visible = false; } }
public void Initialize(ShipData shipData) { foreach (Vector2 otherHardPoint in shipData.OtherHardPoints) { HardPointUI hardPointUI = new HardPointUI(Parent, otherHardPoint); hardPointUI.LoadContent(); hardPointUI.Initialize(); OtherHardPointUI.Add(hardPointUI); } foreach (Vector2 engineHardPoint in shipData.EngineHardPoints) { HardPointUI hardPointUI = new HardPointUI(Parent, engineHardPoint, "Sprites\\UI\\InGameUI\\EngineHardPointUI"); hardPointUI.LoadContent(); hardPointUI.Initialize(); EngineHardPointUI.Add(hardPointUI); } }