1. 新增iOSWiFiHelper类实现异步获取WiFi SSID,自动请求位置权限 2. 新增iOS权限描述本地化处理器,实现中英文权限文案自动切换 3. 更新所有iOS权限描述为更清晰的英文/中文说明 4. 优化iOS编译后处理脚本优先级,避免被其他插件覆盖 5. 在连接设备页面和WiFi设置页面自动填充当前WiFi名称 6. 更新应用版本号与构建号
27 lines
874 B
C#
27 lines
874 B
C#
#if UNITY_IOS
|
|
using UnityEditor;
|
|
using UnityEditor.Callbacks;
|
|
using UnityEditor.iOS.Xcode;
|
|
using System.IO;
|
|
|
|
public class iOSPermissionPostProcessor
|
|
{
|
|
[PostProcessBuild]
|
|
public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
|
|
{
|
|
if (target != BuildTarget.iOS) return;
|
|
|
|
string plistPath = Path.Combine(pathToBuiltProject, "Info.plist");
|
|
PlistDocument plist = new PlistDocument();
|
|
plist.ReadFromString(File.ReadAllText(plistPath));
|
|
|
|
PlistElementDict rootDict = plist.root;
|
|
|
|
// 添加摄像头权限描述
|
|
rootDict.SetString("NSCameraUsageDescription", "Camera access is used to scan the QR code on your device for pairing. For example, scan the QR code on the device body to complete the connection.");
|
|
|
|
File.WriteAllText(plistPath, plist.WriteToString());
|
|
}
|
|
}
|
|
#endif
|