arimger / Unity-Editor-Toolbox

Tools, custom attributes, drawers, hierarchy overlay, and other extensions for the Unity Editor.
MIT License
1.7k stars 125 forks source link

[Feature Request] - Display events with multiple parameters #95

Open zRevenger opened 9 months ago

zRevenger commented 9 months ago

Hi, here with a new request. I think it would be useful to have a way to display UnityEvents with multiple parameters in the inspector without the need to create custom classes for every single use case.

arimger commented 9 months ago

Hello, do you mean something similar to this package? https://github.com/Thundernerd/Unity3D-ExtendedEvent

zRevenger commented 9 months ago

Yes, something similar, if possible even filtering method choices would be useful, so that I could potentially just show a select amount of methods

arimger commented 8 months ago

I will consider it but don't promise anything. It looks like a lot of work. BTW. where do you use UnityEvents while working on your projects? In the UI-related scripts? I'm asking because in my personal experience we should rather avoid them.

zRevenger commented 8 months ago

I use them to modularize stuff, like making attacks or similar behaviors, i make single modules that can act on their own and I'm able to add them to scriptable objects that require them. This way I make a functionality once, no need to repeat it or copy paste it or anything similar, it'll be easily maintainable and fixable in case of problems, and most of all since it's already implemented my designers can use it for as many things as they want. idk if it makes sense worded like this tho

arimger commented 8 months ago

I don't know your approach and haven't seen any code but in terms of extensibility and maintainability I suggest hiding functionalities behind interfaces, it's really powerful approach since Unity supports direct references/types serialization ([SerializeReference]). It's really hard to debug and track things when using serializable events but of course it's a great tool when using in small area/system so maybe it suits your needs perfectly, if so then just ignore my comments.