安定したスクリプティングランタイムには、従来のスクリプティングランタイムよりも大きな .NET クラスライブラリ API が付属しています。つまり、コードサイズは大きくなりがちです。このサイズの増加は、特に、サイズが制限された 事前 (Ahead-Of-Time、AOT) プラットフォームでは顕著になります。
コードサイズの増加を緩和するには
可能なかぎり小さい .NET プロファイルを選択します (.NET プロファイルのサポート を参照)。 .NET Standard 2.0 プロファイルは .NET 4.x プロファイルの約半分のサイズなので、可能な場合は .NET Standard 2.0 プロファイルを使用します。
Enable Strip Engine Code in the Unity Editor Player Settings (go to Edit > Project Settings > Player). This option statically analyzes the managed code in the Project, and removes any unused code. Note: This option is only available with the IL2CPP scripting backend.