Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created June 11, 2016 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/0d6f7787e721a355099ca5e5c174e39a to your computer and use it in GitHub Desktop.
Save flushpot1125/0d6f7787e721a355099ca5e5c174e39a to your computer and use it in GitHub Desktop.
Emulation for clicking button of uGUI
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class ButtonClickSimulator : MonoBehaviour {
[SerializeField] Button button;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown (KeyCode.E)) {
button.onClick.Invoke ();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment