This commit is contained in:
DCFApixels 2025-03-13 16:24:52 +08:00
parent 019766b2c0
commit b171fb3c3b

View File

@ -7,8 +7,11 @@ namespace DCFApixels.DragonECS.Unity.Editors
{ {
internal class MonoScriptsAssetProcessor : AssetPostprocessor internal class MonoScriptsAssetProcessor : AssetPostprocessor
{ {
private static long _version; private static long _timeTicks;
public static long Version { get { return _version; } } public static long Version
{
get { return _timeTicks; }
}
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths, bool didDomainReload) private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths, bool didDomainReload)
{ {
_removedScriptGuids.Clear(); _removedScriptGuids.Clear();
@ -25,10 +28,13 @@ namespace DCFApixels.DragonECS.Unity.Editors
RemoveAssetPath(str); RemoveAssetPath(str);
} }
for (int i = 0; i < movedFromAssetPaths.Length; i++)
{
RemoveAssetPath(movedFromAssetPaths[i]);
}
for (int i = 0; i < movedAssets.Length; i++) for (int i = 0; i < movedAssets.Length; i++)
{ {
//Debug.Log("Moved Asset: " + movedAssets[i] + " from: " + movedFromAssetPaths[i]); //Debug.Log("Moved Asset: " + movedAssets[i] + " from: " + movedFromAssetPaths[i]);
RemoveAssetPath(movedFromAssetPaths[i]);
ProcessAssetPath(movedAssets[i]); ProcessAssetPath(movedAssets[i]);
} }
@ -38,7 +44,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
//} //}
_version = DateTime.Now.Ticks; _timeTicks = DateTime.Now.Ticks;
} }