Closed newcreativegamer closed 1 year ago
As a workaround for now, I reverted that to your old version:
`public void Refresh() { Icons.Clear();
foreach (var folder in IconFolders)
{
if (folder == null) continue;
var root = AssetDatabase.GetAssetPath(folder);
var files = Directory.GetFiles(root, "*.png", SearchOption.AllDirectories).ToList();
foreach (var file in files)
{
var sprite = UnityEditor.AssetDatabase.LoadAssetAtPath<Sprite>(file);
var icon = new ItemIcon { Id = sprite.name, Sprite = sprite };
if (Icons.Any(i => i.Id == icon.Id))
{
Debug.LogErrorFormat("Duplicated icon id: {0}", icon.Id);
}
else
{
Icons.Add(icon);
}
}
}
Icons = Icons.OrderBy(i => i.Id).ToList();
EditorUtility.SetDirty(this);
}`
Hello! No. IconCollection refresh works fine with the latest asset version.
Exception: Incorrect path: Assets/HeroEditor/Common/Icons/BodyParts/Beard/Basic/Beard1.png
Assets.HeroEditor.Common.Scripts.Collections.IconCollection.Refresh () (at Assets/HeroEditor/Common/Scripts/Collections/IconCollection.cs:40)
Assets.HeroEditor.Common.Scripts.Editor.IconCollectionEditor.OnInspectorGUI () (at Assets/HeroEditor/Common/Scripts/Editor/IconCollectionEditor.cs:22)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass71_0.
I'm on 7.1
The latest version is 7.2. Check this with clean asset setup to a new empty project.
Works in 7.2, cheers
Hi,
I refreshed the Icon collection and nothing passed the regex Line 38 of IconCollection.cs:
var match = Regex.Match(path, @"Assets\/HeroEditor\/(?<Edition>\w+)\/(.+?\/)*Icons\/WithoutBackground\/\w+\/(?<Type>\w+)\/(?<Collection>.+?)\/(.+\/)*(?<Name>.+?)\.png");
Any ideas what's wrong?