ICommandTarget.InvokeCommand() should not be generic for AOT compiler. We need to support 3 command types: int, string, enum. All of these can be packed into a pointer-sized non-generic structure. Also majority (like 99%) of the use-cases only need 0 or 1 argument. Thus, the 2 new structs should be designed: Command and Variant. ICommandTarget should look like this:
bool InvokeCommand(Command cmd, Variant args);.
ICommandTarget.InvokeCommand()should not be generic for AOT compiler. We need to support 3 command types:int,string,enum. All of these can be packed into a pointer-sized non-generic structure. Also majority (like 99%) of the use-cases only need 0 or 1 argument. Thus, the 2 new structs should be designed:CommandandVariant.ICommandTargetshould look like this:bool InvokeCommand(Command cmd, Variant args);.