title: Unity Double Click event
body: <p>I am new here and I'm beginning my adventure with UNITY. I have problem with double click event. I'd like to buying or selling something in my shop. When I assign a button on unity (<code>public Button button;</code>) earlier it works. But when i try this change to button on Start and Update methods: </p>
  
  <pre><code>    void Start () {
      button = GameObject.Find(EventSystem.current.currentSelectedGameObject.name).GetComponent&lt;Button&gt;();
      button.onClick.AddListener(ButtonListner);
  }
  void Update()
  {
      button = GameObject.Find(EventSystem.current.currentSelectedGameObject.name).GetComponent&lt;Button&gt;();
  }
  private void ButtonListner()
  {
      counter++;
      if (counter == 1)
      {
          StartCoroutine("doubleClickEvent");
      }
  }
  
  IEnumerator doubleClickEvent()
  {
  
      yield return new WaitForSeconds(clickTimer);
      if (counter &gt; 1)
      {...}
  </code></pre>
  
  <p>the method doubleClickEvent() doesnt work unfortunately...
  What shall I do? Regards ;)</p>