1.环境准备
HslCommunication.dll (版本:11.5.3.0)
Newtonsoft.Json.dll (版本 13.0.1.25517)
2.client相关
using UnityEngine;
using HslCommunication.MQTT;
using System.Text;
using System;
using UnityEngine.Networking;
using System.Collections;
using Google.Protobuf;
using Newtonsoft.Json;
public class MqttManager : MonoBehaviour
{
private MqttClient mqttClient;
void Start()
{
StartCoroutine(Post(OnWebCallback));
}
//post 请求 获取mqtt信息 业务相关代码和谐掉了
public IEnumerator Post(Action<string> callback)
{
// yield return new WaitForSeconds(5f);
string url = "www.baidu.com";
var request = new UnityWebRequest(url, "POST");
string json = "~~~";
byte[] bodyRaw = new System.Text.UTF8En