Profiler Module (プロファイラーモジュール) エディターは、Unity の Profiler ウィンドウに独自のカスタムモジュールを追加するためのツールです。また、ビルトインのカウンターをモジュールに追加したり、ランタイム API を使って独自のカスタムカウンターをモジュールに追加することもできます。独自のカウンターを実装する方法については、Profiling パッケージのドキュメント Profiler Counters API を参照してください。
特に、より深く分析したい統計情報を絞り込む必要がある場合や、アプリケーションに関するカスタム統計情報を Profiler ウィンドウに加える場合に便利です。
プロファイラーモジュールエディターを使用するには、Profiler ウィンドウを開き (Window > Analysis > Profiler)、Profiler Modules ドロップダウンを選択します。
歯車アイコンを選択すると、プロファイラーモジュールエディター ウィンドウが開きます。ウィンドウには 3 つの列があります。
カスタムモジュールを作成するには、プロファイラーモジュールエディターウィンドウの左下にある Add ボタンを選択します。Unity は、New Profiler Module という名前の新しい プロファイラーモジュールをリストに追加します。モジュールの名前を変更するには、テキストフィールドをクリックして、キーボードで名前を設定します。
カスタムプロファイラーモジュールでデータを収集するには、モジュールが追跡するためのカウンターを少なくとも 1 つ加える必要があります。Unity のビルトインカウンターを加えることも、ProfilerRecorder API を使用して独自のカウンターを作成してモジュールに加えることもできます。利用可能なカウンターのリストは、 Available Counters ペインに表示されます。
Profiler ウィンドウにデータをロードしないと、作成したカウンターは、プロファイラーモジュールエディターをロードしたときに Available Counters ペインに表示されません。カスタムカウンターを表示するには、作成したカウンターを含むデータをプロファイラーでキャプチャまたはロードして、プロファイラーモジュールエディターを再度開く必要があります。
利用可能な Unity のカウンターは、メモリ、レンダー、仮想テクスチャリング の 3 つの領域に分かれています。これらの領域で利用できる特定のカウンターの詳細については、各モジュールのドキュメントを参照してください。
API を使用して独自のカウンターを追加する場合は、まず Profiler ウィンドウにデータをロードまたは収集する必要があります。そうすると、プロファイラーモジュールエディターの User の見出しの下にある Available Counters ペインに、カスタムカウンターが表示されます。
カウンターをモジュールに追加するには、Available Counters リストでカウンターを選択して、 Add Selected ボタンを選択します。また、カウンターをダブルクリックしてモジュールに加えることもできます。Unity は、これらのカウンターを選択した Profiler モジュールに追加します。複数のカウンターを一度にモジュールに加えるには、Shift を押しながら 2 つのカウンターをクリックして 2 つのカウンターの間にあるすべてのカウンターを選択するか、Ctrl (macOS では Command) を押しながら 1 つずつカウンターを選択してから、Add Selected ボタンを選択します。
カウンターの並び替えは、ドラッグアンドドロップで行うことができます。1 つのモジュールに追加できるカウンターの数は最大 10 個です。
カスタムモジュールが完成したら、プロファイラーモジュールエディターウィンドウの右下にある Save Changes ボタンを選択します。Unity がウィンドウを閉じると、Profiler ウィンドウに新しいモジュールが表示されます。
ビルトインモジュールでデータを効果的に使用したり比較するために、Profiler ウィンドウのモジュールの順番を変えることができます。これを行うには、プロファイラーモジュールエディターを開き、Profiler Modules ペインにモジュールをドラッグアンドドロップします。
この機能は、ビルトインの Profiler データのスパイクに対して、アプリケーションのカスタム要素を検査したい場合に特に有効です。
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.