示例#1
0
 private void HandleChatLine(string line)
 {
     NetworkMessenger.Broadcast(new ChatInputMessage {
         ChatLine = string.Format(line)
     });
     UIManager.Instance.ChatInput.text = string.Empty;
 }
示例#2
0
 //A server has connected tot he client
 public override void OnClientConnect(NetworkConnection conn)
 {
     ClientsNetworkConnection = conn;
     Debug.Log("A server has connected to the client");
     NetworkMessenger.Broadcast(new TestMessage {
         TestInt = 1337
     });
 }
示例#3
0
 public void Update()
 {
     if (Input.GetMouseButton(0) && !EventSystem.current.IsPointerOverGameObject())
     {
         var        inputRay = Camera.main.ScreenPointToRay(Input.mousePosition);
         RaycastHit hit;
         if (Physics.Raycast(inputRay, out hit))
         {
             Debug.Log("Sending hex update broadcast.");
             NetworkMessenger.Broadcast(new HexUpdateMessage {
                 color = Color.red, hitPoint = hit.point
             });
         }
     }
 }