Unity には 3 つの UI システムが用意されており、Unity エディターや Unity エディターで作成したアプリケーションのユーザーインターフェース (UI) を作成するのに使用できます。
このページでは、それぞれの概要を説明します。
UI Toolkit は、Unity の最新の UI システムです。UI Toolkit は、プラットフォーム間でパフォーマンスを最適化するように設計されており、標準的なウェブ技術を基本としています。UI Toolkit を使用して、Unity エディターの拡張機能を作成したり、ゲームやアプリケーションのランタイム UI を作成できます (UI Toolkit パッケージ をインストールする場合)。
UI ツールキットには以下が含まれます。
Unity では、UI Toolkit を新しい UI 開発プロジェクトで推奨される UI システムにすることを目指していますが、Unity UI (uGUI) や IMGUI にあるいくつかの機能がまだ欠けています。
Unity User Interface (Unity UI) パッケージ (uGUI とも呼ばれます) は古いゲームオブジェクトベースの UI システムで、ゲームやアプリケーションのランタイム UI を開発するために使用できます。Unity UI では、コンポーネントとゲームビューを使用して、ユーザーインターフェイスの配置、位置、スタイルを設定します。Unity UI は、高度なレンダリングやテキスト機能をサポートしています。
詳しくは、マニュアル と API リファレンス を参照してください。
即時モードの GUI (Immediate Mode Graphical User Interface, IMGUI) はコードで操作される UI ツールキットで、OnGUI
関数とそれを実装するスクリプトを使用して、ユーザーインターフェースの描画と管理を行います。IMGUI を使って、スクリプトコンポーネント用のカスタムインスペクター、Unity エディター用の拡張機能、ゲーム内デバッグ表示などを作成することができます。ランタイム UI の構築には推奨されません。
Unity は、UI Toolkit が新しい UI 開発プロジェクトの推奨 UI システムになることを意図していますが、Unity UI (uGUI) や IMGUI にあるいくつかの機能がまだ欠けています。これらの古いシステムは、特定のユースケースでは優れており、古いプロジェクトをサポートするために必要です。
プロジェクトでどのような UI システムを選択するかは、開発を予定している UI の種類やサポートする機能によって異なります。
利用可能な UI システムの比較は、Unity の 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.