H_SafeExperienceDrivingSystem/U3D_DrivingSystem/Assets/Script/test.cs

29 lines
506 B
C#

using System;
using UnityEngine;
namespace Script
{
public class test : MonoBehaviour
{
private ModbusTcpClient client;
private void Start()
{
hh();
}
async void hh()
{
// 使用
client = new ModbusTcpClient();
await client.ConnectToServer();
Debug.Log("123");
}
private void OnDestroy()
{
client.CloseConnection();
}
}
}