Example #1
0
        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);
        }
Example #2
0
 private void OnClientReceiveMessage(JoinMessage message)
 {
     PlayerNames[message.SenderId] = message.PlayerName;
     DebugLog.All(message.PlayerName, "joined!");
 }
Example #3
0
 private void OnServerReceiveMessage(JoinMessage message)
 {
     _joinHandler.SendToAll(message);
 }