47 lines
852 B
C#
47 lines
852 B
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
using UnityEngine.UI;
|
|
|
|
namespace Script
|
|
{
|
|
public class test : MonoBehaviour
|
|
{
|
|
|
|
public Texture2D ttt;
|
|
public void HHHH()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
private ModbusTcpClient client;
|
|
public RawImage raw;
|
|
private void Start()
|
|
{
|
|
|
|
this.GetComponent<Button>().onClick.AddListener(delegate
|
|
{
|
|
SceneManager.LoadScene("menu");
|
|
});
|
|
// hh();
|
|
}
|
|
|
|
|
|
|
|
async void hh()
|
|
{
|
|
// 使用
|
|
client = new ModbusTcpClient();
|
|
await client.ConnectToServer();
|
|
|
|
Debug.Log("123");
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
client.CloseConnection();
|
|
}
|
|
}
|
|
} |