public void OnPlayerScoresChanged()
    {
        Debug.Log("OnPlayerScoreChanged");
        PlayerScores playerScores = roomPropertyAgent.GetPropertyWithName("PlayerScores").GetValue <PlayerScores>();

        Debug.Log(playerScores);

        if (playerScores != null && playerScores.scores != null)
        {
            foreach (Score s in playerScores.scores)
            {
                if (s.score >= 3)
                {
                    if (s.playerRemoteId == NetworkClient.Instance.PlayerId)
                    {
                        winnerPanel.gameObject.SetActive(true);
                    }
                    else
                    {
                        gameOverPanel.gameObject.SetActive(true);
                    }
                    break;
                }
            }
        }
    }
Example #2
0
        //****************** Room Property Events *********************//
        public void OnEncryptedDataReady()
        {
            Debug.Log("OnEncryptedDataReady");
            EncryptedData encryptedData = roomPropertyAgent.GetPropertyWithName(ENCRYPTED_DATA).GetValue <EncryptedData>();

            OnGameDataReadyEvent.Invoke(encryptedData);
        }