From 37e476e9e8f26587f1511f1855fe14494fccef8c Mon Sep 17 00:00:00 2001 From: Matthew Collier <51029884+Squaresweets@users.noreply.github.com> Date: Wed, 23 Jun 2021 20:24:24 +0100 Subject: [PATCH] Made it so the transport only starts finding a match when available Which I should have done earlier really --- BubbleTransport/BubbleTransport.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BubbleTransport/BubbleTransport.cs b/BubbleTransport/BubbleTransport.cs index 7c11de3..f6c0508 100644 --- a/BubbleTransport/BubbleTransport.cs +++ b/BubbleTransport/BubbleTransport.cs @@ -127,6 +127,7 @@ With an Invite (https://www.youtube.com/watch?v=e-RCPvUYxr4 [Example has 3 playe /// public void FindMatch() { + if (!Available()) return; if (Mirror.NetworkManager.singleton.maxConnections > 4) { Debug.LogError("Real time Game Center Matches support a max of 4 players"); @@ -140,7 +141,7 @@ public void FindMatch() public override bool Available() { #if UNITY_IOS - return Application.platform == RuntimePlatform.IPhonePlayer && available && new System.Version(Device.systemVersion) >= new System.Version("13.0"); + return available && new System.Version(Device.systemVersion) >= new System.Version("13.0"); #else return false; #endif @@ -168,6 +169,7 @@ public override void Shutdown() [AOT.MonoPInvokeCallback(typeof(OnInviteRecievedDelegate))] static void OnInviteRecieved() { + if (!instance.Available()) return; //An invite has been recieved, we shutdown the network and then call FindMatch if (NetworkManager.singleton.isNetworkActive) {