use enter key unity

C#
if (Input.GetKey(KeyCode.Return))
Source

Also in C#: