Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Some Attribute #21

Merged
merged 5 commits into from
Sep 11, 2023

Conversation

witalosk
Copy link
Contributor

@witalosk witalosk commented Sep 7, 2023

image

クラスのメンバーを描画するときに、[Header("header")], [Space], [HideInInspector] 属性を表示に反映するようにしました。

When drawing members of the class, the [Header("header")], [Space], and [HideInInspector] attributes are now reflected in the drawing.

Copy link
Owner

@fuqunaga fuqunaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@witalosk
プルリクありがとうございます!
いい機能追加だと思います

2点修正の提案でコード内にコメントしてみました

また将来的な課題として(UI.Field()のようにメンバーが自動的に展開されるエレメントである)UI.Slider(),UI.MinMaxSlider()への対応も考えたいと思います
処理の共通化とExampleのまとめ方などを考える必要がありちょっとめんどくさそうなのでまずはこのプルリクでUI.Field()のみの対応としたいと考えてます

@@ -204,9 +209,10 @@ public ReflectionCache(Type type, IReadOnlyCollection<FieldInfo> fis, IEnumerabl
{
type = pair.Item2,
memberInfo = pair.Item1,
propertyAttributes = pair.Item1.GetCustomAttributes<PropertyAttribute>().ToArray(),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@witalosk
PropertyAttribute.order順にするのはここでやっちゃっえば、BinderToElement_Field.csでOrderBy()しなくていい気がします

range = pair.Item1.GetCustomAttribute<RangeAttribute>(),
isHideInInspector = pair.Item1.GetCustomAttribute<HideInInspector>() != null,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@witalosk
HideInInspectorAttributeでフィールドを非表示にするのはこの下で、
「HideInInspectorAttributeならuiTargetPropertyOrFieldsNameTypeDicへの登録を省く」とすると、UI.Slider()などにも対応できるのでよさそうです

@witalosk
Copy link
Contributor Author

@fuqunaga
レビューありがとうございます!
指摘していただいた点を修正してみました。時間があるときに確認していただけるとありがたいです!

@fuqunaga fuqunaga merged commit aff1e5b into fuqunaga:main Sep 11, 2023
@github-actions
Copy link

🎉 This PR is included in version ga.fuquna.rosettaui-v1.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants