Open airzocker opened 2 years ago
Hello. this constructions is not supported in C# plugin.
Hello. this constructions is not supported in C# plugin.
Oh ok, so is it because the C# plugin is not updated for the newer C#/.Net Framework version or because Unity did something special? I don't know much about this kind of construct other than it's a lambda function.
yeap. I'm not implemented this features yet
I just remembered that it could be something special from Unity, because as far as I remember, the Entities.ForEach() gets some code gen before compile time, so it might not even be completely valid C# code in the correct Framework...
using var
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-8.0/using
It's C# 8.0 feature (almost all C# 8 features not implemented yet)
Ok thanks, and for the ref
part, I'm not sure if it's also a C# 8.0 feature, but here is an example that works in Unity perfectly fine.
And if I try to access the itemDataArray by index later:
Looks like the same. Ref locals C# (C# 7 missed)
Since it's var, type inference is broken and this[] not resolved.
I will review this issues, but need time, I'm very busy with new branch.
Thanks for reporting
About in
Hi, since I started a project with DOTS, I've been getting wrong syntax error highlighting in Entities.ForEach() lambda calls.
Code example:
Consulo marks the "in" keyword as red, with the errors "Identifier expected" and "Expected comma".
Maybe it's just some .NET framework version not matching or something, but I can't figure it out.
EDIT: Also I had some syntax error highlighting issues with a
using var x = y;
+ following code using x, and generally when working withref
s.