본문 바로가기

Unity

Starting TCP by Unity (2) - Client

https://soja-dev.tistory.com/4

 

유니티 TCP 시작하기(1) - Server

먼저 C#을 활용하여 Server를 만든 후 유니티를 활용하여 Client로써 Server에 접속할 것이다. 그럼 먼저 Server를 만들어 보자. https://github.com/SoftwareDevJake/TCPServer GitHub - SoftwareDevJake/TCPServ..

soja-dev.tistory.com

If you completed making a server by above, then now let's make a client to connect to it

https://github.com/SoftwareDevJake/TCPClient

 

GitHub - SoftwareDevJake/TCPClient

Contribute to SoftwareDevJake/TCPClient development by creating an account on GitHub.

github.com

Again we get files from git clone.

And create a new project from Unity.

Example of creating a new project

After that, put all the files you've got into Assets/Scripts/.

(You can create a new Scripts folder to put them in or simply drag w

hat you downloaded into Assets folder.

Example of create empty

And use Create Empty in Unity Scene for creating Client, SocketServer, ThreadManager.

(Right click on your mouse in Hierarchy and find Create Empty.)

Hierarchy, Project example

Drag Client script into the Client object,

SocketServer script into SocketServer object,

ThreadManager script into ThreadManager object.

Example of result

Make sure if you have same IP and Port number as Server.

Start Server first then start Unity, and you'll see the connected result as above!