private IEnumerator SendJoinMessage(string playerName) { yield return(new WaitUntil(() => PlayerTransformSync.LocalInstance != null)); var message = new JoinMessage { PlayerName = playerName, SenderId = PlayerTransformSync.LocalInstance.netId.Value }; _joinHandler.SendToServer(message); }
private void OnClientReceiveMessage(JoinMessage message) { PlayerNames[message.SenderId] = message.PlayerName; DebugLog.All(message.PlayerName, "joined!"); }
private void OnServerReceiveMessage(JoinMessage message) { _joinHandler.SendToAll(message); }