Unity は、.NET Standard と .NET Framework の 2 つの .NET プロファイルをサポートしています。各プロファイルは、C# コードが .NET クラスライブラリと相互作用できるように、異なる API セットを提供しています。 Api Compatibility Level プロパティには以下の 2 つの設定があります。
デフォルトでは、Api compatibility Level は .NET Standard に設定されています。 .NET プロファイルを変更するには、Edit > Project Settings > Player > Other settings を開き、Configuration という見出しの下の Api Compatibility Level を希望の設定にします。
幅広いクロスプラットフォームの互換性が必要な場合は、Api Compatibility Level を .NET Standard に設定してください。Unity は、可能な限り全てのプラットフォームで .NET Standard プロファイルの API をサポートします。.NET Standard プロファイルを完全にサポートしていないプラットフォームもありますが、.NET Framework プロファイルはクロスプラットフォームの互換性にはあまり適していません。.NET Framework プロファイルには、.NET Standard プロファイルの全ての API と追加的 API が含まれており、そのうちの一部が、ほとんどの (あるいは全ての) プラットフォーム上で、動作しない可能性があります。
マネージプラグイン は、Unity の外部で管理され、ダイナミックリンクライブラリ (DLL) にコンパイルされる、.NET アセンブリです。マネージプラグインは、.NET Standard プロファイルか .NET Framework プロファイルのいずれかを用いて Unity で使用することができます。Unity プロジェクトの .NET プロファイルは、異なるバージョンの .NET 用にコンパイルされたマネージプラグインのサポートレベルを決定します。以下の表で、Unity のサポートする設定を確認できます。
Managed plug-in compilation target | API Compatibility Level: | |
---|---|---|
.NET Standard 2.1 | .NET 4.x | |
.NET Standard (任意のバージョン) | サポートあり | サポートあり |
.NET Framework (任意のバージョン) | 限定サポート | サポートあり |
.NET Core (任意のバージョン) | サポートなし | サポートなし |
Unity で .NET Standard プロファイルを使用する場合、.NET Framework 用にコンパイルされたマネージプラグインのサポートは制限されます。.NET Framework API のうち、.NET Standard にも存在するものは全てサポートされます。ただし、.NET Framework API には、.NET Standard プロファイルでは利用できない型やメソッドが含まれています。
UnityWebRequest API と全ての .NET Framework Web API は、WebGL を除く全てのプラットフォームで TLS 1.2 を完全にサポートしています。WebGL では、アプリケーションが実行されるブラウザとウェブサーバーのセキュリティ設定が使用されます。プラットフォーム固有のローカル証明書ストアは、利用可能な場合自動的に TLS 証明書を検証します。証明書ストアにアクセスできない場合、Unity はビルトインのルート証明書ストアを使用します。
2018–03–15 修正されたページ
.NET プロファイルのサポートは 2018.1 で追加NewIn20181
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.