Jelajahi Sumber

调试自动打包

LiuQilin 8 tahun lalu
induk
melakukan
38555b8ba0

+ 10 - 13
Assets/AtlasUtility/Script/Editor/TestEditor.cs

@@ -10,6 +10,8 @@
     using UnityEngine;
     using UnityEngine.UI;
 
+    using ChillyRoom.UnityEditor.iOS.Xcode;
+
     [CustomEditor(typeof(Test))]
     public class TestEditor : Editor
     {
@@ -30,23 +32,18 @@
 
             if (GUILayout.Button("Test"))
             {
-                //Texture2D texture2D = new Texture2D(Script.Texture2D.width, Script.Texture2D.height, TextureFormat.RGBA32, false);
+                string plistPath = "C:/Users/Administrator/Desktop/IOS/Info.plist";
+
+                PlistDocument plist = new PlistDocument();
+
+                plist.ReadFromFile(plistPath);
 
-                //for (int i = 0; i < texture2D.width; i++)
-                //{
-                //    for (int j = 0; j < texture2D.height; j++)
-                //    {
-                //        texture2D.SetPixel(i, j, Script.Texture2D.GetPixel(i, j));
-                //    }
-                //}
 
-                //texture2D.Apply();
+                string projectPath = PBXProject.GetPBXProjectPath("C:/Users/Administrator/Desktop/IOS/");
 
-                //File.WriteAllBytes("Assets/Test.png", texture2D.EncodeToPNG());
+                PBXProject project = new PBXProject();
 
-                //PlayerPrefs.SetString("AtlasUtility_ReferenceTableText", "");
-                //PlayerPrefs.SetString("AtlasUtility_ReferenceTableGUID", "");
-                //PlayerPrefs.SetString("AtlasUtility_SerializeObjectGUID", "");
+                project.ReadFromFile(projectPath);
             }
         }
     }

+ 18 - 0
Assets/Resource/Logo.unity

@@ -427,6 +427,7 @@ GameObject:
   m_Component:
   - component: {fileID: 1833966245}
   - component: {fileID: 1833966244}
+  - component: {fileID: 1833966246}
   m_Layer: 0
   m_Name: ManagerGame
   m_TagString: Untagged
@@ -460,3 +461,20 @@ Transform:
   m_Father: {fileID: 0}
   m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &1833966246
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1833966243}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: ef3c42f14ba649d4aaf2ea3afe194ba7, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  Sprite: {fileID: 0}
+  Graphic: {fileID: 0}
+  TextAsset1: {fileID: 0}
+  TextAsset2: {fileID: 0}
+  Texture2D: {fileID: 0}
+  SpriteRenderer: {fileID: 0}

+ 1 - 1
Assets/Resource/Prefab/Object/Music.prefab

@@ -36,7 +36,7 @@ Transform:
   m_PrefabInternal: {fileID: 100100000}
   m_GameObject: {fileID: 1668329280249666}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
-  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalPosition: {x: 0, y: 0, z: -30}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children: []
   m_Father: {fileID: 0}

+ 5 - 12
Assets/Script/Editor/PostProcessor.cs

@@ -56,16 +56,12 @@ public class NewBehaviourScript
 
         plist.ReadFromFile(plistPath);
 
-        //plist.root.SetString("Bundle display name", "${CFBundleDisplayName }");
-        plist.root["Bundle display name"] = new PlistElementString("Bundle display name");
+        plist.root.SetString("CFBundleDisplayName", "${CFBundleDisplayName}");
+
+        NativeLocale.AddLocalizedStringsIOS(buildPath, Application.dataPath + "/AppleDependency");
+
+        File.WriteAllText(projectPath, project.WriteToString());
 
-        //var infoDirs = Directory.GetDirectories(Application.dataPath + "/AppleDependency/");
-        //for (var i = 0; i < infoDirs.Length; ++i)
-        //{
-        //    var files = Directory.GetFiles(infoDirs[i], "*.strings");
-        //    project.AddLocalization(Path.GetFileNameWithoutExtension(files[i]), "InfoPlist.strings", "InfoPlist.strings");
-        //}
-        
 
         //修改UnityAppController.mm
         string scriptPath = buildPath + "/Classes/UnityAppController.mm";
@@ -132,9 +128,6 @@ public class NewBehaviourScript
 
         //urlDict.SetString("URL Schemes", "MyLovelyGarden");
         //urlDict.SetString("CFBundleURLSchemes", "MyLovelyGarden");
-        
-        //PlistElementArray urlInnerArray = urlDict.CreateArray("TestScheme");
-        //urlInnerArray.AddString("TestValue");
 
 
         //保存Plist

+ 2 - 0
Assets/Xcode/NativeLocale/Editor/NativeLocale.cs

@@ -10,6 +10,8 @@ public class NativeLocale
     public static void AddLocalizedStringsIOS(string projectPath, string localizedDirectoryPath)
     {        
         DirectoryInfo dir = new DirectoryInfo(localizedDirectoryPath);
+        Debug.Log(dir.Exists);
+
         if(!dir.Exists)
             return;