From ec736dfc9ee28688da74d95adabbc26e0bc54ce5 Mon Sep 17 00:00:00 2001 From: LadyEbony Date: Sat, 22 Aug 2020 03:42:25 -0700 Subject: [PATCH] fix to online lobby continue options i hope? --- Assets/RealCode/GameBoardInstance.cs | 24 ++++++++++++-------- Assets/RealCode/Menu/Rematch.cs | 2 +- Assets/Scenes/Board Render/BoardRender.unity | 8 +++++++ 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/Assets/RealCode/GameBoardInstance.cs b/Assets/RealCode/GameBoardInstance.cs index 5721ecf..795004d 100644 --- a/Assets/RealCode/GameBoardInstance.cs +++ b/Assets/RealCode/GameBoardInstance.cs @@ -46,23 +46,15 @@ public class GameBoardInstance : MonoBehaviour { response = PlayerProperties.GetAllResponse(); if (PlayerProperties.playerResponse.GetLocal() == 2){ - response = 2; + response = 0; } } else { response = PlayerProperties.playerResponse.GetLocal(); } switch(response){ + // leave room case 0: - SetupGame(); - break; - case 1: - case -2: - GameTransition.Instance.state = GameState.Lobby; - player1.Clear(); - player2.Clear(); - break; - case 2: if (NetworkManager.inRoom){ NetworkManager.net.OpLeaveRoom(); GameTransition.Instance.state = GameState.Multiplayer; @@ -72,6 +64,18 @@ public class GameBoardInstance : MonoBehaviour { player1.Clear(); player2.Clear(); break; + // return to lobby or not enough players + case 1: + case -2: + GameTransition.Instance.state = GameState.Lobby; + player1.Clear(); + player2.Clear(); + break; + // rematch + case 2: + SetupGame(); + break; + // disconnected case -3: GameTransition.Instance.state = GameState.Menu; player1.Clear(); diff --git a/Assets/RealCode/Menu/Rematch.cs b/Assets/RealCode/Menu/Rematch.cs index cc1dd71..fe020dd 100644 --- a/Assets/RealCode/Menu/Rematch.cs +++ b/Assets/RealCode/Menu/Rematch.cs @@ -27,7 +27,7 @@ public class Rematch : MonoBehaviour { continueBar.fillAmount = delta; if (delta <= 0f && PlayerProperties.playerResponse.GetLocal() == -1){ - PlayerProperties.playerResponse.SetLocal(2); + PlayerProperties.playerResponse.SetLocal(0); } } } diff --git a/Assets/Scenes/Board Render/BoardRender.unity b/Assets/Scenes/Board Render/BoardRender.unity index 84ecb4a..aea3b4e 100644 --- a/Assets/Scenes/Board Render/BoardRender.unity +++ b/Assets/Scenes/Board Render/BoardRender.unity @@ -1576,6 +1576,14 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 1262069058, guid: adba91609cb1e5448b76682be198fc9b, type: 3} + propertyPath: option + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 1638383394, guid: adba91609cb1e5448b76682be198fc9b, type: 3} + propertyPath: option + value: 0 + objectReference: {fileID: 0} - target: {fileID: 2074502350, guid: adba91609cb1e5448b76682be198fc9b, type: 3} propertyPath: m_AnchorMin.y value: 0