private void Awake() { if (Instance != null) { skipCalls = true; Destroy(gameObject); return; } Instance = this; }
private void Awake() { if (Instance != null) { skipCalls = true; Destroy(gameObject); return; } Instance = this; }
/// <summary> /// Clean all the sockets and connections /// </summary> private void OnApplicationQuit() { if (NetWorkers == null || NetWorkers.Count == 0) { return; } Networking.Disconnect(); UnityEventObject.Cleanup(); Threading.Task.KillAll(); NetWorkers.Clear(); NetWorkers = null; instance = null; }