using System.Collections.Generic; using System.IO; using UnityEditor; namespace Aliciza.UXTool { [System.Serializable] [FilePath("ProjectSettings/UXPrefabTabsConfig.asset")] internal class UXPrefabTabsConfig : ScriptableSingleton { public List tabs = new(); public void SyncTabs() { var dirty = false; for (int i = 0; i < tabs.Count; i++) { string assetPath = AssetDatabase.GUIDToAssetPath(tabs[i]); #if UNITY_6000_OR_NEWER if (string.IsNullOrEmpty(assetPath) || !AssetDatabase.AssetPathExists(assetPath)) { tabs.RemoveAt(i); dirty = true; } #else if (string.IsNullOrEmpty(assetPath) || !File.Exists(assetPath)) { tabs.RemoveAt(i); dirty = true; } #endif } if (dirty) Save(); } } }