Esempio n. 1
0
    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();
    }
Esempio n. 2
0
    /**
     * 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);
    }
Esempio n. 3
0
 void Awake()
 {
     PlanetChangeNotifier.instance().addObserver(this);
 }
Esempio n. 4
0
 protected virtual void Awake()
 {
     planetToDisplay = null;
     PlanetChangeNotifier.instance().addObserver(this);
 }