void Awake() { if (Application.platform != RuntimePlatform.WebGLPlayer) { socketIO = gameObject.AddComponent <NativeSocketIO>(); socketIO.Init(settings); } }
private void Awake() { if (Application.platform == RuntimePlatform.WebGLPlayer) { socket = gameObject.AddComponent <WebGLSocketIO>(); } else { socket = gameObject.AddComponent <NativeSocketIO>(); } socket.Init(settings); }
void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else if (instance != null) { Destroy(gameObject); } if (Application.platform == RuntimePlatform.WebGLPlayer) { socketIO = gameObject.AddComponent <WebGLSocketIO>(); } else { socketIO = gameObject.AddComponent <NativeSocketIO>(); } socketIO.Init(settings); }
public void Connect() { print("CONNECTING"); socketIO.Init(settings); socketIO.Connect(); }
public void ResetSettings() { socketIO.Init(settings); }