-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unity 2018 could not use unity-net #399
Comments
Yes, the code is currently written with "latest" in mind. I've done a quick check, and adding I'm uncertain of the wisdom of forcing the library to adopt down-level C#; my understanding - right or wrong - is that unity should be able to consume the code as a library, in which case: the language version used does not matter. Is there a blocking issue with consuming the library as a library? Is there some additional build target / TFM that we should add, for example? |
lol; if you fix the first 100-or-so, you get more - as the compiler realises there are more invalid things |
I pushed a branch there ^^^ to investigate what the impact of this would be; frankly, I consider many of those changes serious regressions, and I'd rather pursue just about any alternative than to merge that branch. So: what is the issue that prevents Unity consuming this as a library package? That is my ideal solution here. |
thanks for reply,using the src code as a library works perfect on android platform.but on IOS,it goes wrong JIT in unity does not work on IOS,cause some Serialization error |
Have you tried 2.3.10? Some changes went out over the weekend that might help with some categories of errors. |
You might also get better experiences if you limit it to the NETStandard1.0 target - this omits the entire IL generation part of the codebase, which is probably where most of the iOS problems come in. |
ok,I'll try 2.3.10 then |
Unity supports two different runtimes one for 3.5 and under and another for 4.x and above. On top of that if you choose 4.x you have a choice of 4.x api or standard 2 api. If you are on Unity 2018 you should be using the 4.x runtime unless there are other reasons not to. |
Using it as a library has issues for cross-platform use - Unity only uses the latest version of .NET on WIndows platforms. Otherwise, you're restricted to .NET 2.0 via MONO on Linux and MacOS, and nothing at all of WebGL, IOS and Android platforms. Adding the source however allows it to operate on every platform. |
That's all well and good, but the usage of latest-C#-version features is likely to increase, not decrease, especially as I try to finish up the "span"/"sequence" work. There are language features in C#7/8 specifically for these scenarios - features that I kinda want. So: it would be a massive problem to restrict language version, at least for the core lib. For generated code (protogen), sure: down-level is fine. I would still rather focus on what target platforms can be maintained to allow it to be used effectively as a library, if unity isn't going to use an up-to-date compiler. |
when i put the unit-net folder into my unity project ,some errors occurs ,like below
public static void WriteDuration(TimeSpan value, ProtoWriter dest) { var seconds = ToDurationSeconds(value, out int nanos); WriteSecondsNanos(seconds, nanos, dest); }
The text was updated successfully, but these errors were encountered: