This commit is contained in:
sin365 2024-12-19 15:13:03 +08:00
parent 4fdd142c13
commit de1d81536b
2 changed files with 12 additions and 4 deletions

View File

@ -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;

View File

@ -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<AxiPrefabCache>(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);