fix to online lobby continue options i hope?

This commit is contained in:
LadyEbony 2020-08-22 03:42:25 -07:00
parent 8e47930a3c
commit ec736dfc9e
3 changed files with 23 additions and 11 deletions

View File

@ -46,23 +46,15 @@ public class GameBoardInstance : MonoBehaviour {
response = PlayerProperties.GetAllResponse(); response = PlayerProperties.GetAllResponse();
if (PlayerProperties.playerResponse.GetLocal() == 2){ if (PlayerProperties.playerResponse.GetLocal() == 2){
response = 2; response = 0;
} }
} else { } else {
response = PlayerProperties.playerResponse.GetLocal(); response = PlayerProperties.playerResponse.GetLocal();
} }
switch(response){ switch(response){
// leave room
case 0: case 0:
SetupGame();
break;
case 1:
case -2:
GameTransition.Instance.state = GameState.Lobby;
player1.Clear();
player2.Clear();
break;
case 2:
if (NetworkManager.inRoom){ if (NetworkManager.inRoom){
NetworkManager.net.OpLeaveRoom(); NetworkManager.net.OpLeaveRoom();
GameTransition.Instance.state = GameState.Multiplayer; GameTransition.Instance.state = GameState.Multiplayer;
@ -72,6 +64,18 @@ public class GameBoardInstance : MonoBehaviour {
player1.Clear(); player1.Clear();
player2.Clear(); player2.Clear();
break; 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: case -3:
GameTransition.Instance.state = GameState.Menu; GameTransition.Instance.state = GameState.Menu;
player1.Clear(); player1.Clear();

View File

@ -27,7 +27,7 @@ public class Rematch : MonoBehaviour {
continueBar.fillAmount = delta; continueBar.fillAmount = delta;
if (delta <= 0f && PlayerProperties.playerResponse.GetLocal() == -1){ if (delta <= 0f && PlayerProperties.playerResponse.GetLocal() == -1){
PlayerProperties.playerResponse.SetLocal(2); PlayerProperties.playerResponse.SetLocal(0);
} }
} }
} }

View File

@ -1576,6 +1576,14 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 0 value: 0
objectReference: {fileID: 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} - target: {fileID: 2074502350, guid: adba91609cb1e5448b76682be198fc9b, type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 0 value: 0