Example #1
0
    // Attached to the Accept button
    // Starts the button sequence to create or delete a save file
    public void ButtonCreateDeleteTransition()
    {
        switch (MainMenuManager.Instance.State)
        {
        case MainMenuManager.MainMenuState.creatingSaveFile:
            if (!inputSaveName.IsActive())
            {
                inputSaveName.gameObject.SetActive(true);
                dropdownDifficulty.gameObject.SetActive(true);
                panelCreateNewSave.SetActive(false);
            }
            else
            {
                CreateUserSaveFile();
                MainMenuManager.Instance.HandleBackInput(true);
            }
            break;

        case MainMenuManager.MainMenuState.loadDeleteMenu:
            if (layoutAcceptDecline.IsActive())
            {
                DeleteUserSaveFile();
                CheckForSaveFile();
                UIUtilities.ChangeButtonVisual(saveButton, emptySaveButtonColors);
                UIUtilities.RenameButton(saveButton, "Empty Save", TextAnchor.MiddleCenter, 18);
                MainMenuManager.Instance.HandleBackInput(true);
            }
            break;
        }
    }