Sure! This is easy, even if the syntax looks bizarre, but it makes perfect sense because here is what’s going on:
What you are going to do is assign the address of the function (i.e., “where can I find FirstFunc?”) to a variable, and in this case we will put them in an array of such things so you can choose randomly.
A function pointer variable in this case is called a System.Action
You can make ONE of them this way:
System.Action whatFunc = FirstFun;
NOTE: FirstFun does not have parentheses after it in this case; you’re just asking “where is it?” you are not calling it yet.
To use the above variable (which can point at any void function), you would use:
whatFunc();
Now, you can make an array of them, as many as you like:
System.Action[] allFuncs = new System.Action[] {
FirstFun,
SecondFun,
ThirdFun,
MoreLikelyFun,
MoreLikelyFun,
};
See how I added one function twice above? That lets me call that function twice as often on average.
Finally, to use it:
// choose one
int whichFunc = Random.Range( 0, allFuncs.Length);
// look up the one we want in the array and call it!
allFuncs[whichFunc]();
You could also pull it out into another temp variable, THEN call it:
System.Action whatToCall = allFuncs[whichFunc];
// call it
whatToCall();
If you expect it to be null, check it before you call it.
Here’s more reading on System.Action and System.Func (when you want to return values from it):