StansAssets / com.stansassets.foundation

Collection of utility methods, design patterns, and extensions for Unity.
https://stansassets.com/
MIT License
129 stars 12 forks source link

feat: call method #88

Closed asd1989dsa closed 2 years ago

asd1989dsa commented 2 years ago

Purpose of this PR

Testing status

Manual testing status

Comments to reviewers

alexey-yaremenko commented 2 years ago

Hi! Well, first of all, thank you for your contribution!

Unfortunately, this solution is incorrect for the following reasons:

  1. Your InspectorButton attribute can't be applied to the method itself. Its AttributeUsage is set to AttributeTargets.Field. Thus, it can be applied to the class fields only.
  2. If you introduce the proper attribute with AttributeTargets.Method usage, this task is unsolvable with the custom PropertyDrawer.

It's cool though, that you managed to implement Playmode & EditorOnly modes for method invocation. If you want to do another iteration on this - you can do it in another pull request.

Thank you for your contribution!

P.S. If you can give a bit more love to the pull request description next time, that would be awesome.