/ Published in: C#
quick example of how to get invoking URL in unity
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// dispatch message. note 'GameObject' is euphemism for whatever game object will have the script attached to it. if (Button ("Get Invoking URL")) { Application.ExternalEval( "u.getUnity().SendMessage('GameObject', 'OnInvokingParamsResponse', window.location.href);" ); } // assuming this script is attached to 'GameObject' this function will be invoked public void OnInvokingParamsResponse(string res) { Debug.Log("invoking params res: "+res); }