/** Fetches the username and logs it to the Unity console. */ public void GetUsername() { browser.EvalJS("document.getElementById('username').value").Then(username => { Debug.Log("The username is: " + username); }).Done(); //Note that the fetch above is asynchronous, this line of code will happen before the Debug.Log above: Debug.Log("Fetching username"); }