// Use this for initialization void Start() { mediaobject = GetComponent <MediaObjectManager>(); mediaobject.MediaLoadCompleteEvent += MediaLoadCompleteEvent; mediaobject.LoadMediaObjects(); client = GetComponent <TcpNetworkClientManager>(); client.ConnectMessage += ConnectMessage; client.ReceiveMessage += ReceiveMessage; udpserver = GetComponent <UdpNetworkListenManager>(); udpserver.UdpNetworkListenEvent += UdpNetworkListenEvent; udpclient = GetComponent <UdpNetworkClientManager>(); #if UNITY_UWP #elif UNITY_EDITOR || UNITY_STANDALONE IPAddress[] address = Dns.GetHostAddresses(Dns.GetHostName()); foreach (var item in address) { if (item.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) { ServerIP = item.ToString(); break; } } #endif }
private void BtnSetHoloLensIP_Click(object sender, EventArgs e) { Properties.Settings.Default.HoloLensIP = txtHoloLensIP.Text; Properties.Settings.Default.Save(); tcpNetworkClientManager = new TcpNetworkClientManager(Properties.Settings.Default.HoloLensIP, Properties.Settings.Default.HoloLensPort); }