public void ResponseUnready(ExtendedEventArgs eventArgs) { ResponseUnreadyEventArgs args = eventArgs as ResponseUnreadyEventArgs; // player[0] represents the the current client player = players[0]; // Ready screen GameObject readyScreen = player.transform.GetChild(1).gameObject; if (args.unreadyPlayer == 1) { Debug.Log("Deactivating player 1 ready button"); readyScreen.transform.GetChild(6).gameObject.GetComponent <Toggle>().isOn = false; player1Ready = false; } else if (args.unreadyPlayer == 2) { Debug.Log("Deactivating player 2 ready button"); readyScreen.transform.GetChild(7).gameObject.GetComponent <Toggle>().isOn = false; player2Ready = false; } if (player1Ready == false || player2Ready == false) { readyScreen.transform.GetChild(3).gameObject.GetComponent <Button>().interactable = false; } }
public override ExtendedEventArgs process() { ResponseUnreadyEventArgs args = null; args = new ResponseUnreadyEventArgs(); args.unreadyPlayer = unreadyPlayer; Debug.Log("Player is unready."); return(args); }