/** * Statically access the end of turn notifier */ public static PlanetChangeNotifier instance() { if (_instance == null) { _instance = new PlanetChangeNotifier(); } return(_instance); }
protected override void Awake() { base.Awake(); CurrentPlayer.instance().addPlayerChangeObserver(this); PlanetChangeNotifier.instance().addObserver(this); TurnHandler.instance().addEndTurnObserver(this); shipDisplayScrollbar.SetActive(false); showingShipScrollbar = false; chosenFleet = null; currentPlayer = CurrentPlayer.instance().getCurrentPlayer(); }
/** * Activates the displays for showing the planet menu * This is what will show the planet statistics, fleet information, etc */ private void activatePlanetMenu() { // Initialize the planet for the displays PlanetChangeNotifier.instance().notify(gameObject); // If the menu is closed, open it and show the currently selected tab tabManager.GetComponent <TabManager>().enableDisplayOnOpen(); // Set the name for the planet display tab planetDisplay.GetComponent <PlanetDisplay>().setName(planetName); // Update the fleet selection for this planet shipDisplay.GetComponent <ShipDisplay>().updateShipListingForPlanet(); // Set the garrison amount for the troop display tab troopDisplay.GetComponent <TroopDisplay>().setGarrisons(garrisons); // Activate the main menu canvasUI.SetActive(true); }
void Awake() { PlanetChangeNotifier.instance().addObserver(this); }
protected virtual void Awake() { planetToDisplay = null; PlanetChangeNotifier.instance().addObserver(this); }