UI 자동화를 위해 바인딩 기능 구현
- 유니티 에셋 인증 오류로 meta 재생성
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Callbacks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace UnityEngine.InputSystem
|
||||
{
|
||||
internal class iOSPostProcessBuild
|
||||
{
|
||||
[PostProcessBuild]
|
||||
public static void UpdateInfoPList(BuildTarget buildTarget, string pathToBuiltProject)
|
||||
{
|
||||
if (buildTarget != BuildTarget.iOS)
|
||||
return;
|
||||
|
||||
var settings = InputSystem.settings.iOS;
|
||||
if (!settings.motionUsage.enabled)
|
||||
return;
|
||||
var plistPath = pathToBuiltProject + "/Info.plist";
|
||||
var contents = File.ReadAllText(plistPath);
|
||||
var description = InputSystem.settings.iOS.motionUsage.usageDescription;
|
||||
#if UNITY_IOS || UNITY_TVOS
|
||||
var plist = new UnityEditor.iOS.Xcode.PlistDocument();
|
||||
plist.ReadFromString(contents);
|
||||
var root = plist.root;
|
||||
var buildKey = "NSMotionUsageDescription";
|
||||
if (root[buildKey] != null)
|
||||
Debug.LogWarning($"{buildKey} is already present in Info.plist, the value will be overwritten.");
|
||||
|
||||
root.SetString(buildKey, description);
|
||||
File.WriteAllText(plistPath, plist.WriteToString());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user