Closed pinguin999 closed 2 years ago
Yes, you can implement it :)
Inside: https://github.com/mcpiroman/UnityNativeTool/blob/bcf66ae9c6d6d873a7ae720fe2d5f02edc0fa820/scripts/DllManipulator.cs#L463 needs to be another case for this type of attribute, analogous to the other ones (MarshalAs, In, Out). This function has to copy attributes - more specifically return CustomAttributeBuilder that has the same type and ctor arguments and fields as the original one.
If you do this, then a PR will be also welcome. If you have difficulties I may find some time somewhen and do it myself.
Hi @mcpiroman
thanks for your help.
I found out that it's the case OptionalAttribute
but I have no Idea what to do in the case.
Is it a quick fix for you or should I think about just removing the optional parameters.
Thanks K
I looked it up and OptionalAttribute
does not have any arguments or properties, so you should just add the case
after In and Out attributes, like
case InAttribute _:
case OutAttribute _:
case OptionalAttribute _:
{
var ctor = attrType.GetConstructor(Type.EmptyTypes);
...
I did not want to do it myself because I would have to setup and run my environment, make some test case... So if you can confirm it indeed works I can just commit it as such.
It works. Thanks!
Added in 004b328
Is this feature planed? Or can someone implement it?
Thanks