예제 #1
0
    // ------------------------------------------------------------------------------------------------------
    // ----------- Save/Cancel stuff: --------------------------------------------------------
    // ------------------------------------------------------------------------------------------------------

    public void buttonPressed_cancel()
    {
        if (buttonsCanBePressed)
        {
            if (nextHasBeenPressed)
            {
                window_Name.SetActive(false);
                buttonPressed_tab_effect(openTab);

                cancelButtonGrey_image.sprite = sprite_CancelGrey;
                saveButtonGrey_image.sprite   = sprite_Next;

                nextHasBeenPressed = false;
                StartCoroutine("playSlideInAnimation_tabs");
                tabsCanBePressed = true;
            }
            else if (somethingHasBeenChanged)
            {
                popupManager.requestOpenMenu_popup(Constants.popupID_cancel);
            }
            else
            {
                shipSelection.closeEditMenu();
            }
        }
    }
    public void buttonPressed_apply()
    {
        if (buttonsCanBePressed_confirm && requestCloseMenu_popup())
        {
            switch (openPopupID)
            {
            case Constants.popupID_delete:
                shipSelection.deleteSelectedShip();
                break;

            case Constants.popupID_cancel:
                shipSelection.closeEditMenu();
                break;

            // case Constants.popupID_value_red:
            // case Constants.popupID_value_green:
            default:     //Constants.popupID_value_blue:
                editMenuManager.moveSliderInCode(openPopupID, (byte)Mathf.Min(int.Parse(textInputField.text), 255));
                break;
            }
        }
    }