- Home /
This post has been wikified, any user with enough reputation can edit it.
Question by
$$anonymous$$ · Jan 17, 2017 at 02:33 PM ·
unity 5scripting problemmonodevelopmono
Why C# 6.0 features could be used in manual plugin (dll) but not able to compile when used as Unity Script directly?
Hi all,
For example, following code used Auto-Property Initializers which is introduced as a C# 6.0 feature.
public string Name { get; }
So when running it directly from Editor, it will throw following error:
*Assets/Test.cs(6,30): error CS0840: `Test.Name.get' must have a body because it is not marked abstract or extern. The property can be automatically implemented when you define both accessors*
While it is built into a dll file and then used from Unity, then it could pass.
BTW, I have noticed that Unity Editor is running on Mono version 2.6.5 while MonoDevelop is on 4.0.5. My Unity version is 5.4.2f2.
Comment