コード例 #1
0
        private static VariantType Make(Type type)
        {
            var variantType = PropertyDrawerHelper.GetTargetType(type);

            if (!s_VariantCache.TryGetValue(variantType, out var entry))
            {
                entry = new VariantType(variantType);
                s_VariantCache[variantType] = entry;
            }
            return(entry);
        }
コード例 #2
0
        private static OptionsHelper Make(Type type)
        {
            var targetType  = PropertyDrawerHelper.GetTargetType(type);
            var optionField = targetType.GetField(OptionPropertyName, BindingFlags.Instance | BindingFlags.NonPublic);
            var optionType  = optionField.FieldType;

            if (!s_OptionCache.TryGetValue(optionType, out var entry))
            {
                entry = new OptionsHelper(optionType);
                s_OptionCache[optionType] = entry;
            }
            return(entry);
        }