- Home /
Application.ExternalCall crashing webplayer in chrome
Hi. I'm simply trying to relay some information over to my webserver via externalcall. After the server receives the info, it is processed then the server returns a response. Originally, I was trying yield until the results were received, but I figured that this might be the issue. So I changed to a simple waiting script in the update function...
private function AttemptSearch(step : int)
{
waitAction = 'AnotherMethod';
waitStep++;
isWaiting = true;
switch(step)
{
case 0:
Application.ExternalCall('function name',data); // This is where unity crashes
break;
case 1:
data = aCore.Method(aCore.responseText);
Application.ExternalCall('function name',more data);
break;
case 2:
more data = aCore.Method(aCore.responseText);
aCore.AnotherMethod(data, more data);
break;
case 3:
waitAction = '';
isWaiting = false;
waitStep = 0;
ScreenResponse(aCore.responseText);
}
}
function Update()
{
if (isWaiting)
{
if (aCore.responseText!='')
{
switch(waitAction)
{
case 'AnotherMethod':
AttemptSearch(waitStep);
}
}
}
}
After I changed to this, I made 100% SURE that there were no longer any yield statements within any of my scripts... However, unity still crashes upon calling the first application.externalcall... The funny part is, in the method it is calling, I added an alert to show if the data was coming through. After unity crashes and chrome asks if I want to stop running it, the alert comes up with the data and even the following alert that shows the processed response from the server. It's driving me crazy and I don't know what to fix. Thank you for any help!