ProjectDDD/Assets/_Datas/02.Scripts/AddressableManager.cs
2025-07-02 17:09:53 +09:00

25 lines
611 B
C#

using System.Linq;
#if UNITY_EDITOR
using UnityEditor.AddressableAssets;
#endif
public class AddressableManager : Singleton<AddressableManager>
{
public static bool HasLabel(string addressKey, string label)
{
#if UNITY_EDITOR
var settings = AddressableAssetSettingsDefaultObject.Settings;
if (settings == null) return false;
var entry = settings.groups
.SelectMany(g => g.entries)
.FirstOrDefault(e => e.address == addressKey);
if (entry == null) return false;
return entry.labels.Contains(label);
#else
return true;
#endif
}
}