// ------------------------------------------------------------------------------------------------------
    // ----------- Array management stuff: --------------------------------------------------------
    // ------------------------------------------------------------------------------------------------------

    public void loadShipButtons(ShipDataPacket shipDataPacket)
    {
        ShipDataIndividual[] shipData = shipDataPacket.getShipData();
        int numOfSavedShips           = shipDataPacket.getNumOfSavedShips();

        shipButtonArray = new ShipButtonScript[numOfSavedShips];

        for (int index = 0; index < numOfSavedShips; index++)
        {
            createNewShipButton(index, shipData[index].getShipName(), shipData[index].getCannonSelection());
        }

        moveShipButtonNewToTheEndOfTheList();

        currentlySelectedButton = shipDataPacket.getPreviouslySelectedShip();

        if (currentlySelectedButton >= 0)
        {
            shipSelection.buttonPressed_ShipButton(currentlySelectedButton);
        }
        else
        {
            shipSelection.buttonPressed_SelectRandom();
            firstButtonSelected = true;
        }
    }
Beispiel #2
0
    public void buttonPressed_ShipButton_effect(int selectedButton)
    {
        if (currentlySelectedButton < 0)
        {
            playerShip_normal.SetActive(true);
            playerShip_invis.SetActive(false);

            randomQuestionmarkIcon.SetActive(false);
            newPlusIcon.SetActive(false);
        }

        currentlySelectedButton = selectedButton;
        shipButtonManager.selectButton_effect(selectedButton);

        getTempDataFromShipData(shipDataPacket.getShipData()[selectedButton]);
        shipTextureManager.changeColors(tempShipColor, tempSailPatternSelection, tempSailIsMirrored_horizontal, tempSailIsMirrored_vertical);
    }