Ejemplo n.º 1
0
 /**
  * Statically access the end of turn notifier
  */
 public static PlanetChangeNotifier instance()
 {
     if (_instance == null)
     {
         _instance = new PlanetChangeNotifier();
     }
     return(_instance);
 }
Ejemplo n.º 2
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();
    }
Ejemplo n.º 3
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);
    }
Ejemplo n.º 4
0
 void Awake()
 {
     PlanetChangeNotifier.instance().addObserver(this);
 }
Ejemplo n.º 5
0
 protected virtual void Awake()
 {
     planetToDisplay = null;
     PlanetChangeNotifier.instance().addObserver(this);
 }