In order to call a web page function from within your Unity web player content you must use the Application.ExternalCall() function. Using that function you can call any JavaScript function defined in the web page, passing any number of parameters to it. Here is an example Unity script that uses theApplication.ExternalCall() function to call a function named SayHello() found within the web page, passing a piece of string data as an argument:
Application.ExternalCall( "SayHello", "The game says hello!" );
The web page would need to define the SayHello() function, for example:
No comments:
Post a Comment