Change the zAutogenerated asset prefix to directory-like:

- Change the zAutogenerated__ prefix to zAutogenerated/
- This allows the zAutogenerated/ assets to display in a dedicated menu in the animation editor when the animator is selected.
- For legacy compatibility, the old prefix is still matched for the invocation of ClearPreviousAssets() in addition to the new.
This commit is contained in:
Haï~
2024-02-04 04:23:10 +01:00
parent 89f176a6d2
commit 689080e032
2 changed files with 14 additions and 6 deletions
@@ -553,7 +553,12 @@ namespace AnimatorAsCode.V1
var allSubAssets = AssetDatabase.LoadAllAssetsAtPath(AssetDatabase.GetAssetPath(_configuration.AsPersistentContainerRequired()));
foreach (var subAsset in allSubAssets)
{
if (subAsset.name.StartsWith($"zAutogenerated__{_configuration.AssetKey}__")
if (
(
subAsset.name.StartsWith($"{AacInternals.AutoGeneratedPrefix}{_configuration.AssetKey}__")
|| subAsset.name.StartsWith($"{AacInternals.AutoGeneratedLegacyPrefix}{_configuration.AssetKey}__")
)
&& (subAsset is AnimationClip || subAsset is BlendTree || subAsset is AvatarMask))
{
AssetDatabase.RemoveObjectFromAsset(subAsset);