What you are looking for is a C# feature called delegates.
A delegate is a variable that holds a reference to a method. You can store a reference to a method in such a variable, change which method is stored in it, and execute the currently stored method at a later time, passing whatever data you have available at that time as arguments.
The C# standard already implements some generics that cover the most common use-cases. For example the delegate Func<TResult> that can be used to hold a call to any function that takes no arguments but returns one. Or the delegate Action that represents a method that does not return anything. Both Action and Func also have variants with multiple additional parameters. For example a Func<string, int, float, int> can hold a function that takes an string, an int and a float as parameters and returns an int. Or a Action<GameObject, Transform> represents a method that has no return value but takes a GameObject and a Transform. These two families of delegate templates cover almost all use-cases. So making your own delegate types is usually optional and only required if you want some extra type safety.
For example, if you want to have a script that is supposed to contain "canned calls" to multiple functions that return integers and can then return the sum of the return values when all those functions get executed could look like this:
class FunctionStack() {
private List<Func<int>> functions = new List<Func<int>>();
void AddFunction(Func<int> function)
{
functions.Add(f);
}
int GetResult()
{
int ret = 0;
foreach(Func<int> function in functions) {
ret += function();
}
return ret;
}
}
Feeding that class with functions can be done via methods or via lambdas:
FunctionStack instance = new FunctionStack();
// add a lambda expression that returns 4
instance.AddFunction(() => 4);
// add a lambda function that returns 7 + 3
instance.AddFunction(() => { return 7 + 3; });
// add a call to an existing function.
// Note the missing () behind the function name.
instance.AddFunction(someObject.SomeMethodThatReturnsAnInteger);
// if you want to call an existing function with arguments, then you need to
// wrap those in a lambda:
instance.AddFunction(() => { return Mathf.FloorToInt(transform.position.x); });
// note that none of the functions above get executed until you do this:
Debug.Log(instance.GetResult());