34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
#if UNITY_IOS || UNITY_IPHONE
|
|
using UnityEditor;
|
|
using UnityEditor.Callbacks;
|
|
using UnityEngine;
|
|
|
|
public static class XCodeAutoSet
|
|
{
|
|
[PostProcessBuild(9999)]
|
|
public static void OnPostprocessBuild(BuildTarget target, string buildPath)
|
|
{
|
|
var platform = PlayerPrefs.GetString(XCodeSetWindow.platformKey, string.Empty);
|
|
PbxProjectSet action;
|
|
if (platform.Contains("YuCheng"))
|
|
{
|
|
var sdkPath = Application.dataPath.MoveUp().Open("iOSSdkPlugins/YuCheng");
|
|
action = new PbxProjectSetYuCheng(sdkPath, buildPath);
|
|
}
|
|
else if (platform.Contains("Traceless"))
|
|
{
|
|
var sdkPath = Application.dataPath.MoveUp().Open("iOSSdkPlugins/Traceless");
|
|
action = new PbxProjectSetTraceless(sdkPath, buildPath);
|
|
}
|
|
else
|
|
{
|
|
action = null;
|
|
EditorUtility.DisplayDialog("无法配置iOS",
|
|
string.Format("渠道{0}不能找到配置流程!", !string.IsNullOrEmpty(platform) ? platform : "_"), "确定");
|
|
}
|
|
|
|
if (action != null)
|
|
action.Action();
|
|
}
|
|
}
|
|
#endif |