In a configuration managing script I have the following call on Start()…
Application.ExternalCall("getClientSettingsURL");
Application.ExternalCall("getClientItineraryURL");
This calls the functions below in the html page “hosting” my Unity Web Player …
function getClientSettingsURL(){
// call this to get the client configuration XML URL
var configPath = "http://unityserver/sld/RCCL_Settings.xml";
GetUnity.SendMessage("InitializationManager", "setConfigXMLURL", configPath);
}
function getClientItineraryURL(){
// call this to get the client itinerary XML URL
var itineraryPath = "http://unityserver/sld/RCCL_Itinerary.xml";
GetUnity.SendMessage("InitializationManager", "setItineraryXMLURL", itineraryPath);
}
These in turn call back to the same configuration manager
void setConfigXMLURL(string clientSettings)
{
settingsXmlURL = clientSettings;
print("settings: " + settingsXmlURL);
}
void setItineraryXMLURL(string itinerary)
{
itineraryXmlURL = itinerary;
print("itinerary: " + itineraryXmlURL);
}
My print statements never exectute on the funcitons called from my web page. If I put alert statements into the web page functions I can see my URLs are correct. If I put the alert functions AFTER the SendMessage functions in the web page stuff. The alerts never gets called. The SendMessage function is the hangup.
In addition to the functions listed in my web page I have the following 2 functions for toggling fullscreen and a render mode. These parameterless functions work just fine.
function switchToFullScreenMode() {
// code here to cause the plugin to switch to full screen mode
GetUnity().SendMessage("GUIobject", "switchToFullScreen", 0);
}
function switchToDrawerMode() {
// code here to cause the plugin to switch to in drawer mode
GetUnity().SendMessage("GUIobject", "switchToDrawer", 0);
}
Any ideas what is going on?
–J