title: Unity how to get button input inside C# script?
body: <p>I am writing a game that includes the combo system (it's a script). I currently have it so that the inputs are keys, but I want to change it so it takes button pressing input instead. </p>
  
  <p>Here is the input code:</p>
  
  <pre><code>void Update() {
           if (Input.GetKeyDown(KeyCode.E))
              input = new ComboInput(AttackType.heavy);
           if (Input.GetKeyDown(KeyCode.R))
              input = new ComboInput(AttackType.light);
  }
  </code></pre>
  
  <p>The thing about UI buttons is that they take an onPressed() command, but I cant make a function to give this input because its already in an update function. Any help would be appreciated. </p>