Ejemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sceneName"></param>
 public void MENU_ACTION_GoToPage(string sceneName)
 {
     if (mode.getGameMode())//if multiplayer is true
     {
         //check if both fields are not empty
         print("Multiplayer mode");
         if (string.IsNullOrEmpty(inputName1.getNickName1()) || string.IsNullOrEmpty(inputName2.getNickName2()))
         {
             print("You haven't type your nicknames 1:" + inputName1.getNickName1() + " 2:" + inputName2.getNickName2());
         }
         else
         {
             Application.LoadLevel(sceneName);
         }/**/
     }
     else
     {
         print("Single mode");
         if (string.IsNullOrEmpty(inputName1.getNickName1()))
         {
             print("You haven't type your nickname " + inputName1.getNickName1());
         }
         else
         {
             Application.LoadLevel(sceneName);
             print("NickName: " + inputName1.getNickName1());
         }/**/
     }
 }
Ejemplo n.º 2
0
    /// <summary>
    /// MENs the u_ ACTIO n_ go to page.
    /// </summary>
    /// <param name="sceneName">Scene name.</param>
    public void MENU_ACTION_GoToPage(string sceneName)
    {
        if (mode.getGameMode())//if multiplayer is true
        {
            multiString = "True";
            Save(multiString);
            //check if both fields are not empty
            print("Multiplayer mode");
            if (string.IsNullOrEmpty(inputName1.getNickName1()) || string.IsNullOrEmpty(inputName2.getNickName2()))
            {
                print("You haven't type your nicknames 1:" + inputName1.getNickName1() + " 2:" + inputName2.getNickName2());
                pop_up_message.SetActive(true);
            }
            else
            {
                Application.LoadLevel(sceneName);
                PlayerPrefs.SetString("player1Name", inputName1.getNickName1());
                PlayerPrefs.SetString("player2Name", inputName2.getNickName2());
                PlayerPrefs.Save();
                pop_up_message.SetActive(false);
            }/**/
        }
        else
        {
            multiString = "False";
            Save(multiString);

            print("Single mode");
            if (string.IsNullOrEmpty(inputName1.getNickName1()))
            {
                print("You haven't type your nickname " + inputName1.getNickName1());

                pop_up_message.SetActive(true);
            }
            else
            {
                Application.LoadLevel(sceneName);
                PlayerPrefs.SetString("player1Name", inputName1.getNickName1());
                PlayerPrefs.Save();
                pop_up_message.SetActive(false);
                print("NickName: " + inputName1.getNickName1());
            }/**/
        }
    }