title: How to detect if button is clicked unity?
body: <p>I am not sure how to test if a button is clicked in unity 19.4. This is the code I tested does anyone know how to test things in the Update Method?</p>
  <pre><code>using System.Collections;
  
  using System.Collections.Generic;
  
  using UnityEngine;
  
  using UnityEngine.UI;
  
  public class Controller : MonoBehaviour
  {
  
  [Header(&quot;Button Objects&quot;)]
      public Button buttonOne;
  
  void Update()
      {
          if (buttonOne.clicked == true)
          {
  
              Debug.Log(&quot;It worked :D&quot;);
  
          }
      }
  }
  </code></pre>