Add Unity.Mathematics support
Fixes #1603 (will be appreciated for hacktoberfest-approved label)
This PR would cause problems in an environment where Unity.Mathematics is not installed. And is it only int2?
Hmm, that's right, we need the ability to check availability somehow, it's better in a compile-time context. I added only int2 just to minimize iteration time, it's possible to add other types later when the whole integration circle is passed.
You can use define like this? https://github.com/Cysharp/UniTask/blob/master/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.asmdef#L12-L43
It looks like a solution. I will try it, thanks!
I've added conditional package reference, and plan to think about more formatters little bit later
I've added the most common types from that package, I think it's enough for initial support
thanks, I'll check soon.
And also, could you please mark that PR with label hacktoberfest-accepted?
It's required for Hacktoberfest participation, as described here - https://hacktoberfest.com/participation/#pr-mr-details
Any updates?
Sorry for delayed review, I've checked.
It's almostly ok.
However, still exists "references": ["Unity.Mathematics"] in asmdef.
This is a soft reference and is usually ignored if there is no reference, so there is no problem.
However, I recall that in the past such references have caused problems in dependency resolve. https://github.com/Cysharp/UniTask/issues/98 Therefore, could you please separate the assemblies? Like MessagePack.UnityMathmatics.
I've tried to do it and it looks like a vast refactoring:
- Move Unity.Mathematics formatters from Assets/Scripts/MessagePack/Unity/Formatters.cs require references to IMessagePackFormatter
- IMessagePackFormatter is located in Formatters namespaces -> new asmdef is required
- IMessagePackFormatter requires MessagePackReader, MessagePackWriter, etc
- MessagePackReader, MessagePackWriter are core classes -> more asmdefs are required
So it leads to big diff and I'm not sure it really wanted changes.
What do you think? Maybe I did not correctly understand you?
@neuecc In light of #1734, do you have any fresh ideas for this?
I think it would be better to add it as a UnityMathmaticsResolver and move towards compositing it, rather than including it in UnityResolver.
Now it is separated resolver @neuecc is that what you expected to see, right? Sorry for the delay, I've missed notifications here
Another question in my mind is whether this should target master or develop.
@neuecc, the author has a question for you above.
sorry for delayed response, I'll check soon.
- UnityShims'
UNITY_MATHEMATICS_SUPPORTis meaningless, so I think it's better to include everything. - I said I was against
Unity.Mathematicsbeing included in the main references, but it looks like that hasn't changed. - Let's stop putting it in the StandardResolver.
Thanks for your feedback!
- UNITY_MATHEMATICS_SUPPORT removed from UnityShims
- Considering Unity.Mathematics reference I left a comment previously - https://github.com/MessagePack-CSharp/MessagePack-CSharp/pull/1690#issuecomment-17875664727, are you sure that we need huge refactoring of that area or maybe it should be separated follow-up issue?
- UnityMathematicsResolver usage removed from StandardResolver