Hey,
I got a script that allows me to communicate with a server, and when I first run my game the WWWGateway startes and it runs fine, but when I change it to another scene with Application.LoadLevel and then back to the same scene, it creats another WWWGateway while the first one is still running and it gives me errors.
Is there any way that I can stop that from running when I change between the scenes?
Here is the code
using ULIB;
using UWWWGateway;
public class GatewayManager
{
public static string Host = "http://";
private static string _folder = "/";
private const string File = "gateway.php";
private const string DebugAppName = "";//this is code for find application on server - please see ulib_config.php
private static WwwObject _www;
public static WwwObject Init(string host,string dir)
{
Host = host;
_folder = dir;
Gateway.Debug = true;
Gateway.AppName = DebugAppName;
Gateway.Init(Host, _folder, File, GatewayType.Www);//Init before plugin add!
PluginManager.AddPlugin(new WwwGatewayPlugin());
_www= (WwwObject)Gateway.GetSender(GatewayType.Www);
return _www;
}
/*public static WwwObject WWW
{
get { return _www == null ? Init(Host, _folder) : (WwwObject)Gateway.GetSender(GatewayType.Www); }
}*/
}