https://github.com/erdemkosk/unity-serialportutility
A lightweight and easy-to-use Serial COM library for Unity Game Engine
https://github.com/erdemkosk/unity-serialportutility
port serial unity unity-game-engine
Last synced: 3 months ago
JSON representation
A lightweight and easy-to-use Serial COM library for Unity Game Engine
- Host: GitHub
- URL: https://github.com/erdemkosk/unity-serialportutility
- Owner: erdemkosk
- Created: 2017-12-28T11:53:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-28T11:57:05.000Z (over 7 years ago)
- Last Synced: 2025-02-13T22:49:14.781Z (5 months ago)
- Topics: port, serial, unity, unity-game-engine
- Language: C#
- Size: 152 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unity-SerialPortUtility
A lightweight and easy-to-use Serial COM library for Unity Game Engine. Mono C# Compiler does not support SerialPort events so I decided to develop our library for Unity.
And here's sample code! :+1:
```C#
public class SerialCommManager : MonoBehaviour {
ISerialCommunication serialFacade;
// Use this for initialization
void Start () {
serialFacade = new SerialCommunicationFacade();
}
// Update is called once per frame
void Update ()
{
}
public void ConnectSerial()
{
serialFacade.Connect();}
public void SendValueFromSerial(string value)
{
byte[] buf = System.Text.Encoding.UTF8.GetBytes(value);
serialFacade.SendMessage(buf);
}
public void DisconnectSerial()
{
serialFacade.Disconnect();
}
}
```