UI Builder の中で UI をテストし、デバッグツールを使ってスタイルを調べることができます。
UI ビルダー内で UI をテストするには、Canvas 内で直接、Viewport のツールバーにある Preview モードを有効にします。Preview モードでは、UI Builder 固有の選択オーバーレイとハンドルが Canvas から削除されます。Preview モードが有効になっているかどうかは、Viewport 全体をオレンジ色の境界線で囲んでいるかどうかでわかります。
Preview モードを有効にすると、以下をテストできます。
Foldout
のような状態ベースのコントロールは、クリックすることで展開し、UI の他の部分の反応を見ることができます。IntegerField
のような入力フィールドは、入力検証をテストすることができます。ScrollView
のような大きなコンテナでは、スクロールの上下をテストすることができます。:hover
疑似状態は、ホバー専用のスタイルを確認できます。Preview モードでも、UI を操作することは可能です。ただし、Canvas の選択とマニピュレーターは Preview モードではオフになります。
スタイルがどこから来たのかわからない場合は、UI Builder の Inspector の Matching Selectors セクションで要素のスタイルを見つけることができます。
Matching Selectors セクションに以下が表示されます。
ノート: リストの下位に表示される USS セレクターは、常に上位の USS セレクターの同じスタイルプロパティをオーバーライドします。
Matching Selectors セクションで十分な情報が得られない場合は、UI Toolkit Debugger を使うことができます。UI Toolkit Debugger は、UI エレメントをリアルタイムで検査し、デバッグするために使用するツールです。UI 階層を視覚的に表現します。これを使用して、各 UI 要素の状態とプロパティを調べます。
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.