Example #1
0
    public void SpaceDropLogic(int num)
    {
        Click.Play();

        if (num == 0) // start game
        {
            SceneManager.LoadScene("_Scene_0");
        }

        if (num == 3) // show space shooter history
        {
            SpaceHistoryDropdown.ClearOptions();
            LoadSpaceHistoryDropdown();
            SpaceHistoryPan.SetActive(true);
            Border.SetActive(true);
            CopyText.SetActive(false);
            CreatedByText.SetActive(false);
            MainText.SetActive(false);
            LogoutButton.SetActive(false);
            CopyBG.SetActive(false);
        }

        else // open configurations or game levels
        {
            OpenPannel2 = SpaceFileItems[num];
            OpenPannel2.SetActive(true);
            Border.SetActive(true);
            CopyText.SetActive(false);
            CreatedByText.SetActive(false);
            MainText.SetActive(false);
            LogoutButton.SetActive(false);
            CopyBG.SetActive(false);
        }
    }
Example #2
0
 public void ExitSpaceHistory()
 {
     Click.Play();
     Border.SetActive(false);
     SpaceHistoryPan.SetActive(false);
     CopyText.SetActive(true);
     CreatedByText.SetActive(true);
     MainText.SetActive(true);
     LogoutButton.SetActive(true);
     CopyBG.SetActive(true);
 }
Example #3
0
 public void ExitSpacePannel()
 {
     Click.Play();
     Border.SetActive(false);
     OpenPannel2.SetActive(false);
     CopyText.SetActive(true);
     CreatedByText.SetActive(true);
     MainText.SetActive(true);
     LogoutButton.SetActive(true);
     CopyBG.SetActive(true);
 }
Example #4
0
    public void ExitSpaceGameLevelsPannel()
    {
        int NumofEisGood = 0;
        int ScoreisGood  = 0;

        if (BronzeLevel.NumofE < SilverLevel.NumofESilver && SilverLevel.NumofESilver < GoldLevel.NumofEGold)
        {
            NumofEisGood = 1;
        }

        else
        {
            NumofEisGood = 0;
        }

        if (BronzeLevel.ScoreToWin < SilverLevel.ScoreToWinSilver && SilverLevel.ScoreToWinSilver < GoldLevel.ScoreToWinGold)
        {
            ScoreisGood = 1;
        }

        else
        {
            ScoreisGood = 0;
        }

        if (ScoreisGood == 1 && NumofEisGood == 1)
        {
            Click.Play();
            Border.SetActive(false);
            OpenPannel2.SetActive(false);
            CopyText.SetActive(true);
            CreatedByText.SetActive(true);
            MainText.SetActive(true);
            LogoutButton.SetActive(true);
            CopyBG.SetActive(true);
        }

        else
        {
            SpaceErrorPan.SetActive(true);
            SpaceLevelsExitButton.interactable = false;
        }
    }
Example #5
0
    public void FileDropLogic(int num)
    {
        Click.Play();

        if (num == 0 && Users.CurrentUser.username != "admin") // if you are not the admin accessing user accounts
        {
            CreateUserMenuButton.interactable  = false;
            DeleteUserMenuButton.interactable  = false;
            UnBlockUserMenuButton.interactable = false;
        }

        if (num == 3) // if you are exiting the game
        {
            Users.CurrentUser.Logins.Add(new SessionLogObject());
            Users.DumpUsers();
            Application.Quit();
            PlayerPrefs.DeleteAll();
        }

        if (num == 2) // if you click on the history item
        {
            HistoryDropdown.ClearOptions();

            if (Users.CurrentUser.username != "admin") // if you are not the admin
            {
                LoadHistoryDropdown();                 // load the non-admin history
            }

            else // if you are the admin
            {
                LoadHistoryDropdownAdmin(); // load the admin history
            }
        }
        OpenPannel = FileItems[num];
        OpenPannel.SetActive(true);
        Border.SetActive(true);
        CopyText.SetActive(false);
        CreatedByText.SetActive(false);
        MainText.SetActive(false);
        LogoutButton.SetActive(false);
        CopyBG.SetActive(false);
    }
Example #6
0
    public void MemDropLogic(int num)
    {
        Click.Play();

        if (num == 1) // show memory game history
        {
            LoadHistoryDropdownMem();
            MemHistoryPan.SetActive(true);
            Border.SetActive(true);
            CopyText.SetActive(false);
            CreatedByText.SetActive(false);
            MainText.SetActive(false);
            LogoutButton.SetActive(false);
            CopyBG.SetActive(false);
        }

        else // start game
        {
            SceneManager.LoadScene("MemMainMenu");
        }
    }
Example #7
0
    public void RPSDropLogic(int num)
    {
        Click.Play();

        if (num == 1) // show rock paper scissors history
        {
            LoadHistoryDropdownRPS();
            RPSHistoryPan.SetActive(true);
            Border.SetActive(true);
            CopyText.SetActive(false);
            CreatedByText.SetActive(false);
            MainText.SetActive(false);
            LogoutButton.SetActive(false);
            CopyBG.SetActive(false);
        }

        else // start game
        {
            SceneManager.LoadScene("SinglePlayer");
        }
    }
Example #8
0
    public void AppleDropLogic(int num)
    {
        Click.Play();

        if (num == 1) // show Apple picker history
        {
            LoadHistoryDropdownApple();
            AppleHistoryPan.SetActive(true);
            Border.SetActive(true);
            CopyText.SetActive(false);
            CreatedByText.SetActive(false);
            MainText.SetActive(false);
            LogoutButton.SetActive(false);
            CopyBG.SetActive(false);
        }

        else // start game
        {
            SceneManager.LoadScene("ApplePickerGame");
        }
    }