#if UNITY_EDITOR using System.Collections.Generic; using System.Linq; using Sirenix.OdinInspector; namespace GAS.Runtime { public static class ValueDropdownHelper { /// /// 显示一个下列列表, 包含所有的属性集名称. /// /// 使用示例: /// /// [ValueDropdown("@ValueDropdownHelper.AttributeSetChoices", IsUniqueList = true)] /// public string AttributeSet; /// /// /// public static IEnumerable AttributeSetChoices => ReflectionHelper.AttributeSetNames; /// /// 显示一个下拉列表,包含所有的属性名称. /// /// 使用示例: /// /// [ValueDropdown("@ValueDropdownHelper.AttributeChoices", IsUniqueList = true)] /// public string Attribute; /// /// /// public static IEnumerable AttributeChoices => ReflectionHelper.AttributeNames; private static ValueDropdownItem[] _gameplayTagChoices; /// /// 显示一个下拉列表,包含所有的GameplayTag. /// /// 使用示例: /// /// [ValueDropdown("@ValueDropdownHelper.GameplayTagChoices", IsUniqueList = true, HideChildProperties = true)] /// public GameplayTag[] Tags; /// /// /// public static IEnumerable GameplayTagChoices { get { _gameplayTagChoices ??= ReflectionHelper.GameplayTags .Select(gameplayTag => new ValueDropdownItem(gameplayTag.Name, gameplayTag)) .ToArray(); return _gameplayTagChoices; } } } } #endif