private void RefreshScore(ScoresMessage msg) { if (hostScore != null) { hostScore.GetComponent <Text> ().text = "Host: " + msg.hostScore; } if (clientScore != null) { clientScore.GetComponent <Text> ().text = "Client: " + msg.clientScore; } }
private void SendScoreToClient() { var msg = new ScoresMessage(); msg.hostScore = GameLogic.Instance.hostScore; msg.clientScore = GameLogic.Instance.clientScore; NetworkServer.SendToAll(1001, msg); RefreshScore(msg); GameLogic.Instance.CheckHostScore(); Debug.Log("DISK.client score=" + msg.clientScore + " hostScore=" + msg.hostScore); Debug.Log("DISK.isGameOver=>" + GameLogic.Instance.IsGameOver()); if (GameLogic.Instance.IsGameOver()) { GameLogic.Instance.StopHost(); } }