What kinds of functions are acceptable for ugui onClick event?
So far I noticed that return type must be void and function can have either no parameter or a single primitive parameter string, boolean,…
Do you guys know any definitive rules that would give me the big picture?
Pass it through an int and cast it as an enum when you get it back, you can also give an “Object” Parameter which give you most of the others parameters like GameObject transform and every single object inherited from it
PS : sorry for my english
This is not cool, because it enables a lot of errors during programming. I would also have to remember all the enum types and their order.
well lot of errrors? not really and you don't have to remember the enum types, its written on your code... tho there is no other solution to give an enum parameter, maybe i believe you can use a unity object
I appreciate your effort, but this is nothing short of a bad solution. And after all, its not enum anyway, I might as well use different function which would hold target component as a parameter with common interface or something else... Yes I don't need to memorize the enum, but I would have to go search for it in the code. This would also move error detection from compile time to run time. It is just bad to deprive yourself of all the candy that .NET and unity editor are offering you. Unless its a micro project, you are going to have a bad time.
This is not cool, because it enables a lot of errors during programming. I would also have to remember all the enum types and their order.
– Lovrencwell lot of errrors? not really and you don't have to remember the enum types, its written on your code... tho there is no other solution to give an enum parameter, maybe i believe you can use a unity object
– BrainWashGI appreciate your effort, but this is nothing short of a bad solution. And after all, its not enum anyway, I might as well use different function which would hold target component as a parameter with common interface or something else... Yes I don't need to memorize the enum, but I would have to go search for it in the code. This would also move error detection from compile time to run time. It is just bad to deprive yourself of all the candy that .NET and unity editor are offering you. Unless its a micro project, you are going to have a bad time.
– Lovrenc