Пример #1
0
 /// <summary>
 ///     Method triggered whenever the requirement of recompiling changes
 /// </summary>
 private void OnEnabledChanged(object sender, bool e)
 {
     if (EnableButton.InvokeRequired)
     {
         EnableButton.Invoke(new MethodInvoker(() => { OnEnabledChanged(sender, e); }));
     }
     EnableButton.Text = e ? "Disable" : "Enable";
 }
 public void PushButton()
 {
     if (pressNumber == 0)
     {
         Debug.Log("Button '" + gameObject.name + " is work again!");
         EnableButton.Invoke();
         DistractionsManager.instance.SolveProblem();
         Cursor.visible = false;
         deffect.SetActive(false);
     }
     else
     {
         Debug.Log("Button '" + gameObject.name + " is pushed. Remain: " + pressNumber);
         GameObject aux = Instantiate(more, transform.position, Quaternion.identity);
         Destroy(aux, 0.8f);
         pressNumber--;
     }
 }