diff --git a/Examples/Unity Example 1 - Receive and send with buttons/Example1.unitypackage b/Examples/Unity Example 1 - Receive and send with buttons/Example1.unitypackage new file mode 100644 index 0000000..1283e62 Binary files /dev/null and b/Examples/Unity Example 1 - Receive and send with buttons/Example1.unitypackage differ diff --git a/Examples/Unity Example 1 - Receive and send with buttons/Readme.md b/Examples/Unity Example 1 - Receive and send with buttons/Readme.md new file mode 100644 index 0000000..c8631fc --- /dev/null +++ b/Examples/Unity Example 1 - Receive and send with buttons/Readme.md @@ -0,0 +1,15 @@ +This example receives data from Python3 and displays in app. +A button can be clicked to send a string to Python3 from Unity +Note quit button will not do much unless you build the application. +Note: I use Pycharm as my Python IDE + +Steps +1. Create an empty 3D unity project +2. Drag the unitypackage into your assets folder directly in Unity +3. Import all files +4. You should be asked to download TMPro. +5. Download the essentials only +6. Run the server.py (using Pycharm in my case) Python Script. +7. Run Unity Editor or built app +8. You should see the text at the top of the unity app update each second +9. On clicking the "Send" button, a string should be sent to Python3 and be displayed there diff --git a/Readme.md b/Readme.md index efb0474..5379470 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ Created by Youssef Elashry to solve the common problem for TWO-WAY communication Unity/C# applications with Python 3. -The files attached will allow you to both send and receive data from Unity (C#) and Python 3. +The files attached will allow you to both send and receive data between Unity (C#) and Python 3. Feel free to use this in your individual or commercial projects BUT make sure to reference me as: Two-way communication between Python 3 and Unity (C#) - Y. T. Elashry It would be appreciated if you send me how you have used this in your projects (e.g. Machine Learning) at youssef.elashry@gmail.com @@ -8,13 +8,13 @@ It would be appreciated if you send me how you have used this in your projects ( Use at your own risk Use under the Apache License 2.0 -To run example: -- Ensure IP, send and receive ports are the same between server.py and UdpSocket.cs [edited via inspector] scripts. They are the same in the example. +To run demo: +- Ensure IP, send and receive ports are the same between server.py and UdpSocket.cs [edited via inspector] scripts. They are the same in the demo. - Run server.py on the python side to send and receive data from Unity - Add UdpSocket.cs to a game object in a scene - RECOMMENDED: Run server.py THEN Unity Scene - To be able to use the UdpSocket.cs script for your own script, REMOVE the lines and functions with a // DELETE THIS comment. -These lines and functions are for the purposes of the example and do not affect the main functionality. +These lines and functions are for the purposes of the demo and do not affect the main functionality. ![alt text](https://github.com/Siliconifier/Python-Unity-Socket-Communication/blob/master/Images/Example.png)