public void MulliganCard(MulliganCard mulliganCard) { // Disable selecting further cards for mulliganing until // we receive a response from the server // TODO: TEST THIS //mulliganRow.BlockRaycasts(true); SerializedMulligan message = new SerializedMulligan( "mulligan", new SerializedCard(mulliganCard.id)); SendString(JsonConvert.SerializeObject(message)); ReceiveMulliganHand().Then(hand => { mulliganRow.Populate(hand.cards.Select(c => c.ToMulliganCard(mulliganRow))); mulliganCountText.Increment(); if (mulliganCountText.Count() == 2) { if (hand.selectWhoGoesFirst) { whoGoesFirstScreen.Show(); } else { WaitForStartGameMessage(); } } else { //mulliganRow.BlockRaycasts(false); } }); }
private IEnumerator <System.Object> StartMulliganScene(MulliganResponse hand) { SceneManager.LoadScene("Mulligan"); // After a LoadScene, we must wait one frame before calling FindObjectsOfType yield return(null); mulliganRow = (MulliganRow)FindObjectOfType(typeof(MulliganRow)); whoGoesFirstScreen = (WhoGoesFirstScreen)FindObjectOfType(typeof(WhoGoesFirstScreen)); mulliganCountText = (MulliganCountText)FindObjectOfType(typeof(MulliganCountText)); mulliganRow.Populate(hand.cards.Select(c => c.ToMulliganCard(mulliganRow))); }