6

How to write a TCP client in Unity3d which reads data constantly from a server socket and prints to the console or updates on some text boxes?

4

2 回答 2

2

在 unity3d 中创建 TCP 客户端与在 c# 中开发几乎相同,您可以使用几乎所有的 .net 类(最新的统一 3.5 为 4.0),但在使用类之前,请从这里寻找单声道的支持页。

如果单声道不支持该类,只需从 .net 库中拖动与该类对应的受尊敬的 dll。您也有两种方法可以做到这一点,统一使用 .net 类编写整个逻辑。或者制作一个 dll 并将其导入统一并使用该 dll 来处理 TCP 工作。在性能方面没有区别,一切都取决于你的喜好。

于 2012-05-24T06:11:51.690 回答
0

这可能是一个很好的起点:

http://answers.unity3d.com/questions/15422/unity-project-and-3rd-party-apps.html

于 2011-03-21T06:29:39.050 回答