using AOT;
using ExLog;
using sqsdk;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
namespace TFW
{
public class SQAndroidWebgl : MonoBehaviour
{
[DllImport("__Internal")]
private static extern void login(string json, MyFunc action);
private delegate void MyFunc(string str);
[MonoPInvokeCallback(typeof(MyFunc))]
private static void MyCallback(string str)
{
Debug.LogError($"str:{str}");
}
void Start()
{
UnityLogHelper.Log($"SQAndroidWebgl DoLogin");
DoLogin();
}
public void DoLogin()
{
SQLoginInfo sQLoginInfo = new SQLoginInfo();
sQLoginInfo.gid = "1017927";
sQLoginInfo.pid = "432";
Debug.Log($"SQSDK开始登录webgl gid:{sQLoginInfo.gid} pid:{sQLoginInfo.pid}");
var jsonval = JsonUtility.ToJson(sQLoginInfo);
Debug.Log($"SQSDK开始登录webgl begin");
login(jsonval, MyCallback);
}
void Update()
{
}
}
}