Exemple #1
0
	void Start() {
		_statusText = GameObject.Find("StatusText").GetComponent<Text>();
		
		IPHostEntry entry = Dns.GetHostEntry(Dns.GetHostName());
		_hostAddress = entry.AddressList[0];
		
		GameObject networkObj = new GameObject("Network");
		_tcpNetwork = networkObj.AddComponent<TCPNetwork>();
		_tcpNetwork.RegHandler(NetworkEventHandler);
	}
Exemple #2
0
    void Start()
    {
        _statusText = GameObject.Find("StatusText").GetComponent <Text> ();

        IPHostEntry entry = Dns.GetHostEntry(Dns.GetHostName());

        Debug.Log(entry.HostName);
        _hostAddress = entry.AddressList [0];
        _hostAddress = IPAddress.Parse("127.0.0.1");

        GameObject networkObj = new GameObject("Network");

        _tcpNetwork = networkObj.AddComponent <TCPNetwork> ();
        _tcpNetwork.RegHandler(NetworkEventHandler);
    }