Siccity / SerializableCallback

UnityEvent and System.Func had a child
MIT License
359 stars 53 forks source link

SerializableCallbackDrawer Subclass Return Types #7

Open mooreleo opened 5 years ago

mooreleo commented 5 years ago

The method drop down in the inspector panel does not consider methods with return types that are sub-types of the SerializableCallback class type argument.

Suggest changing line 172 of SerializableCallbackDrawer to the following:

// accept return type and sub-types of return type if (returnType != null && method.ReturnType != returnType && !method.ReturnType.IsSubclassOf(returnType)) continue;

There may be other areas in the project that can also benefit from such logic.

Nice job on the project though, this has solved my problem very well =)