how can i give this ui button an onclick event as well as a keyboard return key ,i think i am not being clear enough ,i want my game to have the same function when i click return and when i click the button on screen ,i for keyboard return one for screen button ,basically how can i give 2 key for same function` public Transform eggpoint;
%|-1560315035_1|%
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyUp("space") || Input.GetMouseButtonDown(0))
{
GetComponent<Rigidbody2D>().velocity = Vector2.zero;
GetComponent<Rigidbody2D>().AddForce(jumpForce);
}
if(Input.GetKeyDown(KeyCode.Return))
{
Instantiate(Egg, eggpoint.position, eggpoint.rotation);
%|657980421_16|%
%|69678579_17|%
%|1246395602_18|%
}`
as you can see i have instantiate function above and now i have the return key from keyboard to execute this fucntion i want my ui button to have the same function how can i achieve this.