Unity - Manual: C# compiler (unity3d.com)



Unsupported featuresC# 9.0
  • Suppress emitting localsinit flag
  • Covariant return types
  • Module Initializers
  • Extensible calling conventions for unmanaged function pointers
  • Init only setters

If you try to use unsupported features in your project, compilation generates errors.

Record support

C# 9 init and record support comes with a few caveats.

  • The typeย System.Runtime.CompilerServices.IsExternalInitย is required for full record support as it uses init only setters, but is only available in .NET 5 and later (which Unity doesnโ€™t support). Users can work around this issue by declaring theย System.Runtime.CompilerServices.IsExternalInitย type in their own projects.
  • You shouldnโ€™t use C# records in serialized types because Unityโ€™s serialization system doesnโ€™t support C# records.


์ง๋ ฌํ™” ํƒ€์ž…์—๋Š” ๋ชป์“ด๋‹ค๋„ค


๊ทธ๋ƒฅ ์•ˆ๋˜๋Š”๊ฑฐ์ž๋„ˆ


[field: SerializeField] ์ด๊ฑฐ ์“ฐ๋ผ๋Š”๊ฑด๊ฐ€