YarnSpinnerTool / YarnSpinner-Unity

The official Unity integration for Yarn Spinner, the friendly dialogue tool.
MIT License
522 stars 91 forks source link

Fixed incorrect order of AddFunction parameter names #248

Closed vertxxyz closed 1 year ago

vertxxyz commented 1 year ago

I have fixed the incorrect order of generic parameter names for AddFunction methods, usage is unchanged, it was just incorrect naming.

The AddFunction methods all have an inverted parameter list, where the return value is specified first. If you attempt to respect what's listed as TResult it will not match the order used by the Func, and will show an error.

image

The names of the generic parameter list involved in the AddFunction methods is now correctly ordered to match the Func that is passed in.

// New
void AddFunction<T1... TResult>(string name, Func<T1... TResult> implementation) {

There should be no change, unless there is codegen based on this code or something else I'm not aware of.
Anything that previously did work must have ignored the names, and anything that didn't couldn't compile anyway.