The Action class?

I’m working on a project where I want to make interchangeable functions. Basically, I’m making a tool where I want to give the user the ability to select which functions get called for certain events.

I’m using C#, and usually for this sort of event coding you use delegates. But I’ve always found the general syntax for writing and using delegates to be confusing and overly verbose. While going through some tutorials last week, I came across the Action class under the System namespace. I found this class much easier to work with. And as near as I can tell, the class exists just as a means of providing a shorthand alternative to regular delegates. I like the more type-based approach, and the limited argument options aren’t a hindrance.

What I need to know is, are there any issues with using Actions in Unity? From the limited experiments I’ve performed, there don’t seem to be any problems. But before I start leaning on the class too much, I wanted to check to see if anyone was familiar with any reasons why I ought to avoid using the Action class in Unity.

I use Action<> and Func<> quite a bit in Unity and I did not run into any issue with that

Thanks for the feedback, giyomu. Yeah, it doesn’t look like there should be any problems with using the Action or the Func classes. I can use Func instances if I need to use functions that return a value. Unless someone else chimes in, I’m going to go ahead and use these delegate shortcuts in my programming.

I use Action, Func and delegates all the time, nothing i have seen wrong with using them.