private void OnDestroy() { if (Instance == this) { Instance = null; } }
private void Awake() { if (Instance) { Debug.LogWarning("RAGMatchmaker already in scene. Deleting myself!"); Destroy(this); return; } Instance = this; matchUp = GetComponent <Matchmaker>(); matchUp.onLostConnectionToMatchmakingServer = OnLostConnectionToMatchmakingServer; }