private void HandleChatLine(string line) { NetworkMessenger.Broadcast(new ChatInputMessage { ChatLine = string.Format(line) }); UIManager.Instance.ChatInput.text = string.Empty; }
//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 }); }
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 }); } } }