From de1d81536bfcdf3b5905d1e1034f401ee323c6da Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Thu, 19 Dec 2024 15:13:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AxiProjectTools/Editors/AxiPrefabCache.cs | 2 +- .../AxiProjectTools/Editors/AxiProjectTools.cs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/AxiProjectTools/Editors/AxiPrefabCache.cs b/AxibugEmuOnline.Client/Assets/AxiProjectTools/Editors/AxiPrefabCache.cs index 9f13930..e6823ad 100644 --- a/AxibugEmuOnline.Client/Assets/AxiProjectTools/Editors/AxiPrefabCache.cs +++ b/AxibugEmuOnline.Client/Assets/AxiProjectTools/Editors/AxiPrefabCache.cs @@ -15,7 +15,7 @@ public class AxiPrefabCache : ScriptableObject public class AxiPrefabCache_Com2GUID { public string SrcFullName; - public string SrcName; + public string SrcName; public string GUID; public string ToName; public string ToPATH; diff --git a/AxibugEmuOnline.Client/Assets/AxiProjectTools/Editors/AxiProjectTools.cs b/AxibugEmuOnline.Client/Assets/AxiProjectTools/Editors/AxiProjectTools.cs index c5790fd..bf80d34 100644 --- a/AxibugEmuOnline.Client/Assets/AxiProjectTools/Editors/AxiProjectTools.cs +++ b/AxibugEmuOnline.Client/Assets/AxiProjectTools/Editors/AxiProjectTools.cs @@ -92,6 +92,14 @@ public class AxiProjectTools : EditorWindow for (int i = 0; i < comCount; i++) { var com = prefabRoot.GetComponentAtIndex(i); + if (com == null) + continue; + + if (com.name.Contains("VideoPlayer")) + { + + } + MonoBehaviour monoCom = com as MonoBehaviour; if (monoCom == null) continue; @@ -127,15 +135,15 @@ public class AxiProjectTools : EditorWindow [MenuItem("Axibug移植工具/[2]生成中间脚本代码")] public static void Part2() { - if (Directory.Exists(outCsDir)) - Directory.Delete(outCsDir); + if (UnityEngine.Windows.Directory.Exists(outCsDir)) + UnityEngine.Windows.Directory.Delete(outCsDir); Directory.CreateDirectory(outCsDir); AxiPrefabCache cache = AssetDatabase.LoadAssetAtPath(cachecfgPath); foreach (var data in cache.caches) { string toName = "Axi" + data.SrcName; string toPath = outCsDir + toName + ".cs"; - string codeStr = "using UnityEngine.UI; public class " + toName + " : " + data.SrcName + " {}"; + string codeStr = "namespace AxibugCom { public class " + toName + " : " + data.SrcFullName + " {} }"; try { System.IO.File.WriteAllText(toPath, codeStr);