Unity 2021 不支持 init-only 属性
今天在学 c# 9.0 的时候看到了一个 init-only的用法,unity中没说不包含,于是拿来在unity里面试了试
提示缺失预定义类型,先后尝试导入System.Runtime 和 System.Private.CoreLib两个文件都不行,后面去查了查
https://forum.unity.com/threads/init-only-setter-not-working-in-2021-2.1222452
添加链接描述
The type System.Runtime.CompilerServices.IsExternalInit is defined in .NET 5 and later, which Unity does not support yet:
现在这个功能在unity中还不支持