Пример #1
0
 // Use this for i14itialization
 void Start()
 {
     Connect();
     RoomInfoPanel.Disable();
     BackButton.Click += new MouseEventHandler(BackButton_Click);
     Time.timeScale    = 1;
 }
Пример #2
0
    IEnumerator TryRegister()
    {
        registerPanel.Disable();
        var user = new Player()
        {
            Username = Username.Text,
            Password = Password.Text,
            Email    = Email.Text,
            Level    = 1,
            Health   = 100
        };


        Task signUpTask = user.SignUpAsync();

        while (!signUpTask.IsCompleted)
        {
            yield return(null);
        }
        if (signUpTask.IsFaulted || signUpTask.IsCanceled)
        {
            DialogPanel.Show("Think differently", "The username or email adress is already in use. Please choose something even more original.");
            DialogPanel.Dismissed += new global::DialogPanel.DismissedEventHandler(DialogPanel_Dismissed);
        }
        else
        {
            LoginPanel.GetComponent <LoginPanel>().Username.Text = user.Username;
            LoginPanel.GetComponent <LoginPanel>().Password.Text = Password.Text;

            registerPanel.Hide();
            LoginPanel.Show();
        }
    }
Пример #3
0
 void ChampionsButton_Click(dfControl control, dfMouseEventArgs mouseEvent)
 {
     if (Player.Level < 4)
     {
         WaitPanel.Show();
         panel.Disable();
     }
     else
     {
         Application.LoadLevel("Champions arena");
     }
 }
Пример #4
0
 void TestButton_Click(dfControl control, dfMouseEventArgs mouseEvent)
 {
     if (TestBrains())
     {
         if (TestWeapons())
         {
             Application.LoadLevel(string.Format("Mission {0}", PlayerPrefs.GetInt(MissionPanel.CURRENT_MISSION, 1)));
         }
         else
         {
             MainPanel.Disable();
             BrainsDialog.ShowDialog("You have to choose a weapon before continuing. Click on the flashing slot to the right to assign.");
             BrainsDialog.panel.Click += new MouseEventHandler(panel_Click);
         }
     }
     else
     {
         MainPanel.Disable();
         BrainsDialog.ShowDialog("You haven't chosen any brains to use for battle! Drag the brains you wish to use down to the selected brains panel.");
         BrainsDialog.panel.Click += new MouseEventHandler(panel_Click);
     }
 }
Пример #5
0
 bool TestOK()
 {
     if (TestBrains())
     {
         if (TestWeapons())
         {
             return(true);
         }
         else
         {
             MainPanel.Disable();
             TrainingDialog.ShowDialog("You have to choose a weapon before continuing. Click on the flashing slot to the right to assign.");
             TrainingDialog.panel.Click += new MouseEventHandler(panel_Click);
         }
     }
     else
     {
         MainPanel.Disable();
         TrainingDialog.ShowDialog("You haven't chosen any brains to use for battle! Drag the brains you wish to use down to the selected brains panel.");
         TrainingDialog.panel.Click += new MouseEventHandler(panel_Click);
     }
     return(false);
 }
Пример #6
0
    void TrainButton_Click(dfControl control, dfMouseEventArgs mouseEvent)
    {
        PhotonNetwork.offlineMode = true;
        bool ok = GetOptimizerSettings();

        if (ok)
        {
            if (NameTextBox.Text == null || NameTextBox.Text.Length == 0)
            {
                panel.Disable();
                TrainingDialog.ShowDialog("You need to enter a name for the brain before continuing.");
                TrainingDialog.panel.Click += new MouseEventHandler(panel_Click);
            }
            else
            {
                if (TestWeapons())
                {
                    PlayerPrefs.SetString("Mode", "Train");
                    //   PlayerPrefs.SetInt("Evolution Speed", GetEvolutionSpeed());

                    Application.LoadLevel("Optimization scene");
                }
                else
                {
                    panel.Disable();
                    TrainingDialog.ShowDialog("You have to choose a weapon before continuing. Click on the flashing slot to the right to assign.");
                    TrainingDialog.panel.Click += new MouseEventHandler(panel_Click);
                }
            }
        }
        else
        {
            panel.Disable();
            TrainingDialog.ShowDialog();
            TrainingDialog.panel.Click += new MouseEventHandler(panel_Click);
        }
    }
Пример #7
0
 void ForgotButton_Click(dfControl control, dfMouseEventArgs mouseEvent)
 {
     loginPanel.Disable();
     DialogPanel.ShowResetPassword();
 }