public static void CreateCitadelScreen(EventArg onSwitchScreen = null) { //Refill all the player ship templates' stats: ShipyardController.RefillShipStats(); GameController.GameState = GameState.Citadel; CreateScreen(new CitadelScreen(), onSwitchScreen); }
private void TryPurchasePlayerShipTemplate() { if (!playerShipTemplate.Unlocked && PlayerController.Player.Balance.Extract(playerShipTemplate.Price)) { //Assign the new ship. ShipyardController.AssignPlayerShip(playerShipTemplate); ///Repurpose the <see cref="button"/> to be used as the "Use" button. button.Text = "Use"; button.SetOnClick(new EventArg1 <PlayerShipTemplate>(ShipyardController.AssignPlayerShip, playerShipTemplate)); } }
private void Load_PlayerShipTemplates() { for (int i = 0; i < PlayerShipTemplates.Templates.Length; i++) { var template = ShipyardController.PlayerShipTemplates.First(t => t.Id == PlayerShipTemplates.Templates[i].Id); if (template != null) { template.Unlocked = PlayerShipTemplates.Templates[i].Unlocked; } } //Assign the new player ship: ShipyardController.AssignPlayerShip(ShipyardController.PlayerShipTemplates.First(t => t.Id == PlayerShipTemplates.CurrentPlayerShipTemplateId)); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { base.Initialize(); DataController.Initialize(); SaveFileController.Initialize(); GameTipsController.Initialize(); AudioController.Initialize(); ShipyardController.Initialize(); GalaxyController.Initialize(); AudioController.PlayBackgroundSong("void"); GameUIController.Initialize(); GameUIController.CreateLoadingScreen(); LoadGame(); }
public override void OnEnable() { base.OnEnable(); senderShipyard = app.controller.buildings[app.controller.buildings.Count - 1] as ShipyardController; base.disableButton.onClick.AddListener(() => AddToShipyard()); }