Exemple #1
0
    void Update()
    {
        showCurrentSquadPoints();

        togglePlayButton();

        if (!prevChosenSize.Equals(LocalDataWrapper.getPlayer().getChosenSize()))
        {
            updateWholeView();
            prevChosenSize = LocalDataWrapper.getPlayer().getChosenSize();
        }

        if (!prevChosenShip.Equals(LocalDataWrapper.getPlayer().getSelectedEmptyShip().ShipId))
        {
            updateViewOnShipSelection();
        }

        if (!prevChosenPilot.Equals(LocalDataWrapper.getPlayer().getSelectedPilot().Name))
        {
            updateViewOnPilotSelection();
        }

        if (LocalDataWrapper.getPlayer().getSquadron() != null && (prevSquadronSize != LocalDataWrapper.getPlayer().getSquadron().Count || prevSquadronCost != LocalDataWrapper.getPlayer().getCumulatedSquadPoints()))
        {
            updateViewOnSquadronChange();
            SaveButton.SetActive(true);
        }

        if ((LocalDataWrapper.getPlayer().getSquadron().Count == 0 || LocalDataWrapper.getPlayer().getSquadron() == null) && SaveButton.activeSelf)
        {
            SaveButton.SetActive(false);
        }

        if (!LocalDataWrapper.getPlayer().getChosenUpgradeType().Equals("") && LocalDataWrapper.getPlayer().getChosenSlotId() != 0 && LocalDataWrapper.getPlayer().getChosenLoadedShip() != null)
        {
            if (!UpgradesPopup.activeSelf)
            {
                showUpgradesPopup();
            }
        }
        else
        {
            if (UpgradesPopup.activeSelf)
            {
                closeUpgradesPopup();
            }
        }

        if (LocalDataWrapper.getPlayer().isLoadingSquadrons() && !fileExplorer.activeSelf)
        {
            showFileExplorer();
        }
        else if (!LocalDataWrapper.getPlayer().isLoadingSquadrons() && fileExplorer.activeSelf)
        {
            SquadBuilderUtil.hideFileExplorer(fileExplorer);
        }
    }