![script debugger run on the main thread script debugger run on the main thread](http://aqueduct.io/docs/img/debugger_screenshot.png)
String serverResponse = "Last Message from Server" + dataFromClient īyte sendBytes = (serverResponse) String dataFromClient = .GetString (bytesFrom) ĭataFromClient = dataFromClient.Substring (0, dataFromClient.IndexOf ("$")) ĭebug.Log (" > Data from Server - " + dataFromClient) NetworkStream.Read (bytesFrom, 0, (int)bytesFrom.Length) NetworkStream networkStream = clientSocket.GetStream ()
![script debugger run on the main thread script debugger run on the main thread](https://i.stack.imgur.com/htqsy.png)
Updatetext.GetComponent().text = "From server: "+tempMesg OThread = new Thread (new ThreadStart (getInformation))
Script debugger run on the main thread how to#
I think the problem is I don't know how to run the main thread and the child thread in C# together? Or there maybe other problems. Getcomponentfastpath can only be called from the main thread The reason for I do not include updatetext.GetComponent().text = "From server: "+tempMesg in the void getInformation is this function is in the thread, when I include that in getInformation() it will come with an error:
![script debugger run on the main thread script debugger run on the main thread](https://d2mvzyuse3lwjc.cloudfront.net/doc/en/CodeBuilder/images/Running_And_Debugging_Labtalk_Scripts/Running_LabTalk_Scripts_91_02.png)
However, When I do the following code, the void update does not calling every time. Each time, when I get a new message I need to update it to the updattext (it is a Unity Text). My problem is I try to use Unity socket to implement something.