jxlast/wb_unity_pro/Assets/Scripts/Platform/PlatformIOS.cs

42 lines
1015 B
C#
Raw Permalink Normal View History

2025-11-14 23:38:35 +08:00
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
public class PlatformIOS : MonoBehaviour
{
public static PlatformIOS Instance;
void Awake()
{
Instance = this;
}
#if UNITY_IPHONE
[DllImport("__Internal")]
public static extern void ShareLink(int id, string json_data);
[DllImport("__Internal")]
public static extern void WXLogin();
[DllImport("__Internal")]
public static extern float GetBatteryLevel();
[DllImport("__Internal")]
public static extern int GetWIFISignalStrength();
[DllImport("__Internal")]
public static extern int GetTeleSignalStrength();
[DllImport("__Internal")]
public static extern void CopyToClipboard(string input);
#endif
static string _roomid = string.Empty;
public void InsertRoom(string roomid)
{
_roomid = roomid;
}
public static string GetRoomID()
{
var tem = _roomid;
_roomid = string.Empty;
return tem;
}
}