资源文件不单独区分文件夹
parent
a2328523e5
commit
f3c353cfc5
|
|
@ -193,12 +193,12 @@ public static class LightmapUtils
|
|||
|
||||
// 1. 移动LightingSettings.asset文件
|
||||
string lightingSettingsPath = $"Assets/{sceneName}_LightingSettings.asset";
|
||||
if (AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(lightingSettingsPath) != null)
|
||||
if (AssetDatabase.LoadAssetAtPath<Object>(lightingSettingsPath) != null)
|
||||
{
|
||||
string destPath = $"{lightmapDirAssetPath}/{sceneName}_LightingSettings.asset";
|
||||
|
||||
// 如果目标已存在,先删除
|
||||
if (AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(destPath) != null)
|
||||
if (AssetDatabase.LoadAssetAtPath<Object>(destPath) != null)
|
||||
{
|
||||
AssetDatabase.DeleteAsset(destPath);
|
||||
}
|
||||
|
|
@ -214,7 +214,20 @@ public static class LightmapUtils
|
|||
|
||||
if (AssetDatabase.IsValidFolder(lightmapSourceDirAssetPath))
|
||||
{
|
||||
string destLightmapDir = $"{lightmapDirAssetPath}/{lightmapDirName}";
|
||||
string[] files = Directory.GetFiles(lightmapSourceDirAssetPath);
|
||||
foreach (string file in files)
|
||||
{
|
||||
if (!file.EndsWith(".meta"))
|
||||
{
|
||||
string fileName = Path.GetFileName(file);
|
||||
AssetDatabase.MoveAsset(file, lightmapDirAssetPath + "/" + fileName);
|
||||
}
|
||||
}
|
||||
|
||||
Directory.Delete(lightmapSourceDirAssetPath);
|
||||
AssetDatabase.Refresh();
|
||||
|
||||
/*string destLightmapDir = $"{lightmapDirAssetPath}";
|
||||
|
||||
// 如果目标已存在,先删除
|
||||
if (AssetDatabase.IsValidFolder(destLightmapDir))
|
||||
|
|
@ -233,7 +246,7 @@ public static class LightmapUtils
|
|||
else
|
||||
{
|
||||
Debug.LogError($"移动光照数据目录失败: {result}");
|
||||
}
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue