Hello, I have a bit of a compound question. With the below script, is it possible to detect what the user has input only AFTER he has pressed enter, then detect that value and print IN THE SAME GUI TEXT? Thanks everyone who can help.
My script:
var stringToEdit : String = "Hello World";
var TextStyle = new GUIStyle();
function OnGUI () {
stringToEdit = GUI.TextField(Rect(0,0,Screen.width,Screen.height), stringToEdit, 1000000000, TextStyle);
}
I did actually look into this method (below) but it detected it before I pressed enter.
if (stringToEdit == "TEST" && Input.KeyCode.Return) {
print("Recieved");
}