36 lines
1000 B (Stored with Git LFS)
C#
36 lines
1000 B (Stored with Git LFS)
C#
using UnityEditor;
|
|
|
|
public static class SLAssetPostprocessorScene
|
|
{
|
|
private static string GetDestPath(string path)
|
|
{
|
|
return path.Replace("/Raw/", "/Addressables/");
|
|
}
|
|
|
|
public static void OnRemove(string path)
|
|
{
|
|
var upperPath = path.ToUpper();
|
|
|
|
if (upperPath.Contains("ASSETS/RAW/SCENES/") == false || upperPath.Contains(".UNITY") == false) return;
|
|
|
|
var destPath = GetDestPath(path);
|
|
AssetDatabase.DeleteAsset(destPath);
|
|
}
|
|
|
|
public static void OnAdd(string path)
|
|
{
|
|
var upperPath = path.ToUpper();
|
|
|
|
if (upperPath.Contains("ASSETS/RAW/SCENES/") == false || upperPath.Contains(".UNITY") == false) return;
|
|
|
|
var destPath = GetDestPath(path);
|
|
AssetDatabase.DeleteAsset(destPath);
|
|
|
|
SLFileUtility.MakeFolderFromFilePath(destPath);
|
|
|
|
AssetDatabase.CopyAsset(path, destPath);
|
|
//var scene = AssetDatabase.LoadAssetAtPath<SceneAsset>(destPath);
|
|
|
|
// TODO: 추가 처리
|
|
}
|
|
} |