UnityPythonConnectionModules

Unity-Python Connection Modules

These are encapsulated Python and Unity modules for continuous TCP communication between these.

For Japanese: 【Python, Unity】(ほぼ)コピペでUnity・Pythonの双方向通信を簡単に記述する

Entire Description

Use

PythonSocket is a server and UnitySocket is the client.
Ignite PythonSocket before the UnityScoket

Data format

Usual Data

these 2 will send the data to each other in the format below:

<s>{json_format_name}!{json}<e>

Don’t use:

The format decoding will get an error.

Quit code

If either Python or Unity quits the connection. They will send a quit code end!

Python Socket

Installation

pip install "git+https://github.com/konbraphat51/UnityPythonConnectionModules.git#egg=UnityConnector&subdirectory=PythonSocket"

How to code

You can observe ManualTester.py for running example.

Brief Description

Use UnityConnector

from UnityConnector import UnityConnector

Making callbacks

Make 3 callbacks:

Unity Socket

Installation

Put

to your Unity project.

Make

and attach

to an UnityObject (anything OK, even a empty class)

Brief Description

You can observe ConnectionTest.cs