Hello!
I am desperatly looking for help! I’m working on RTS game and I want to make an list/array of functions, which the unit would go through in the order and execute the functions one by one. I’ve been googling and trying to figure this out for almost week now.
Currently I have this:
var unitQueue : List.<Function> = new List.<Function>();
public function Move(location) {
//Move to location
}
and I’m trying to add this function in array with:
unitQueue.Add(Move(location));
This returns me an error:
BCE0017: The best overload for the method 'System.Collections.Generic.List.<Function>.Add(Function)' is not compatible with the argument list '(void)'.
Any ideas, fixes?