|
@@ -13,8 +13,6 @@ public class NewBehaviourScript
|
|
[PostProcessBuild(100)]
|
|
[PostProcessBuild(100)]
|
|
public static void OnPostprocessBuild(BuildTarget buildTarget, string buildPath)
|
|
public static void OnPostprocessBuild(BuildTarget buildTarget, string buildPath)
|
|
{
|
|
{
|
|
- Debug.Log(buildPath);
|
|
|
|
-
|
|
|
|
if (buildTarget != BuildTarget.iOS)
|
|
if (buildTarget != BuildTarget.iOS)
|
|
{
|
|
{
|
|
return;
|
|
return;
|
|
@@ -59,9 +57,9 @@ public class NewBehaviourScript
|
|
|
|
|
|
plist.root.SetString("CFBundleDisplayName", "${CFBundleDisplayName}");
|
|
plist.root.SetString("CFBundleDisplayName", "${CFBundleDisplayName}");
|
|
|
|
|
|
- FileUtil.CopyFileOrDirectory(Application.dataPath + "/AppleDependency/InfoPlist.strings", buildPath + "/InfoPlist.strings");
|
|
|
|
|
|
+ FileUtil.CopyFileOrDirectory(Application.dataPath + "/AppleDependency", buildPath + "/AppleDependency");
|
|
|
|
|
|
- project.AddFileToBuild(target, project.AddFile(buildPath + "/InfoPlist.strings", "InfoPlist.strings", PBXSourceTree.Source));
|
|
|
|
|
|
+ project.AddFileToBuild(target, project.AddFile(buildPath + "/AppleDependency/InfoPlist.strings", "InfoPlist.strings", PBXSourceTree.Source));
|
|
|
|
|
|
|
|
|
|
//修改UnityAppController.mm
|
|
//修改UnityAppController.mm
|
|
@@ -125,8 +123,8 @@ public class NewBehaviourScript
|
|
|
|
|
|
//添加URLScheme
|
|
//添加URLScheme
|
|
PlistElementDict urlDict = plist.root["CFBundleURLTypes"].AsArray().AddDict();
|
|
PlistElementDict urlDict = plist.root["CFBundleURLTypes"].AsArray().AddDict();
|
|
-
|
|
|
|
- urlDict.SetString("CFBundleURLSchemes", "MyLovelyGarden");
|
|
|
|
|
|
+ PlistElementArray urlArray = urlDict.CreateArray("CFBundleURLSchemes");
|
|
|
|
+ urlArray.AddString("MyLovelyGarden");
|
|
|
|
|
|
|
|
|
|
//保存Plist
|
|
//保存Plist
|