Version: 2021.1
言語: 日本語
アセットローディングメトリクス
インポート

アセットワークフロー

アセットとは、ゲームやアプリケーションを作成するために、Unity プロジェクトで使用するアイテムのことです。アセットは、3D モデル、テクスチャ、スプライト、サウンドエフェクト、音楽など、プロジェクトの視覚的または聴覚的要素を表します。アセットはまた、カラーグラデーション、アニメーションマスク、任意のテキストや数値データなど、より抽象的なアイテムも表します。

アセットは、3D モデル、オーディオファイル、画像など、Unity の外部で作成されたファイルから取得される場合もあります。Unity で ProBuilder メッシュ、アニメーターコントローラー、オーディオミキサー、レンダーテクスチャなどのアセットタイプを作成できます。

インポート、作成、ビルド、配信、ロード

Unity でのアセットワークフロー
Unity でのアセットワークフロー

上の図は、Unity でアセットを扱う際の典型的なワークフローを示しています。各コラムは以下の説明のように独立したステップを表しています。

  • アセットを Unity エディターに インポート します。
  • Unity エディターとそのアセットを使って、コンテンツを 作成 します。
  • アプリケーションやゲームファイル、そして任意でその付属のコンテンツバンドルを ビルド します。
  • ビルドしたファイルを 配布 し、ユーザーがパブリッシャーやアプリストア経由でアクセスできるようにします。
  • ユーザーの動作や、コンテンツのグループ化とバンドルの方法によって、必要に応じてランタイムにさらに更新を ロード します。

インポート

インポートとは、ソースファイルを Unity エディターで作業できるようにする処理です。ファイルをプロジェクトの Assets フォルダーに保存またはコピーすると、Unity はそのファイルをインポートし、エディターで作業できるようになります。

It’s important to learn some fundamentals of importing assets into Unity, such as where the files are stored in your Project, how to adjust the Import Settings for each kind of asset, what the meta files are fore, and how the Asset Database stores imported data. See Importing Assets for more detail about these topics.

Unity Accelerator を使用することで、チームでの作業時に Unity のアセット処理を高速化することができます。

作成

アセットをプロジェクトにインポートしたら、ゲームやアプリケーションの作成を開始できます。一般的には、アセットをゲームオブジェクトとして シーン に配置し、ユーザーとそれらの相互作用を制御する スクリプト を追加します。

プロジェクトの開発規模が大きくなると、アセットをグループに分ける必要が出てきます。これにより、ランタイムに選択した追加コンテンツを段階的にダウンロードできます。

作成段階で、アセットを別々の バンドル にグループ化する方法についての戦略を決定し、それらをロードするタイミングを選択するコードを実装することができます。

This allows you to manage the download size and memory usage of your game or app by reducing the size of your initial download and loading other assets later at runtime. The recommended way to do this is to use Unity’s Addressables system.

Build

Building refers to the process of exporting your completed project to binary files which you can then distribute and run on the platform of your choice. For example, when building for Windows, Unity will generate an .EXE file, along with some accompanying data files which you can then distribute.

Addressable やアセットバンドルを使ってアセットを別のダウンロード可能なバンドルにまとめている場合は、配信のためにそれらのバンドルファイルもビルドする必要があります。

自身のコンピューターでプロジェクトをビルドすることが可能です。または、Unity の Cloud Build サービス を利用して、Unity プロジェクト用の自動ビルド生成と継続的インテグレーションを利用できます。

配信

ゲームやアプリケーションとそのコンテンツバンドルをビルドしたら、ユーザーがそれにアクセスする方法が必要です。配信方法の選択は、ターゲットとするプラットフォームによって異なります。

例えば、モバイルプラットフォームには独自のアプリストアがあります。専門のパブリッシャーを利用することもできますし、自分のサーバーでホスティングすることもできます。

Unity は、独自の Cloud Content Delivery サービスを提供しており、ゲームやアプリケーションとそのコンテンツをホストしてユーザーに配信することができ、Unity の開発プラットフォームに完全に統合されています。これにより、時間を大幅に節約することができ、コンテンツが豊富なライブゲームや、定期的にコンテンツの更新が必要なアプリケーションに大いに活用できます。

ロード

When users load and use your game or app, the rules and programming that you set up, and the way that you grouped and bundled your assets, all come into play to provide your users with the experience and content they want.

ここで説明した技術やサービスを組み合わせれば、最初のダウンロードを迅速に行い、プロジェクトの存続期間を通して、継続的なアップデートや追加コンテンツを提供できます。


Artist Workflow Benefits

Unity’s asset workflow has tools and features which make it easy to edit and design directly in the Unity Editor.

Programmer Workflow Benefits

  • Enable team efficiency with a tailored content pipeline, for example writing scripts to process assets as they’re imported, or controlling which presets Unity automatically applies based on your own rules.
  • スクリプティングによる ソースアセットの修正 が可能です。マテリアル、メッシュ、物理などのソースアセットをゲームコードで調整することができます。
  • Addressable アセットシステム を使用してメモリを節約します。このシステムは、複雑なプロジェクトのコンテンツ管理を簡素化し、自動メモリ管理とプロファイリングツールを提供します。
  • アセットをターゲットプラットフォームに合わせて最適化します。マルチプラットフォームのプロジェクトでは、何百種類ものテクスチャがあり、それぞれのプラットフォームに合わせて異なる解像度でパッケージ化する必要があります。Unityでは、各ターゲットプラットフォーム用にビルドする際に、アセットのパッケージ化、サイズ変更、再圧縮を自動的に行います。

ワークフローに関するヒント

When working with assets in Unity there are different strategies you can use. Which one suits your project depends on factors such as: the size of your team, the size of your project, your target platforms, the memory availability on those platforms, and whether you want to release updates, patches, and DLC after publishing it.

For example, if you are working in a team, in addition to making use of a version control system for your project, you could also use a Cache Server to cache Unity’s import results, to save time across the team.

別々のバンドルとして公開したい膨大な数のアセットを使っている場合、それらのアセットグループを別のプロジェクトに分けると便利です。そのようにすると、チームのメンバーがそれらのバンドルを使うときに、1 つの巨大なプロジェクトをロードする必要がなくなります。

プラットフォームに関するヒント

If you keep all your assets in a single Project, when you build, Unity automatically builds them in the correct format for the current selected platform. However if you use the technique mentioned above to split your assets accross multiple projects to build your bundles separately, you must make a build for each platform you support. See building for multiple platforms in the Addressables manual for more information.

The characteristics of a platform also determine the restrictions and possibilities of how you organize your runtime Assets. For example, on the standalone (PC or macOS) platforms, virtual memory provides a almost unbounded pool of memory, so using the Resources folder or large asset bundles doesn’t typically pose a memory challenge. Conversely, mobile devices and console platforms typically have limited or nonexistent virtual memory, so apps built for those platforms must manage Asset loading and unloading more efficiently.

また、プラットフォームにおけるユーザーの期待値も重要な要素です。例えば、モバイルプラットフォームでは、最初のダウンロードとインストールのプロセスが長いと、プレイヤーがアプリケーションをプレイする前に放棄してしまう可能性があります。このような理由から、モバイルアプリケーションでは、最初のビルドでは最小限のアセットしか含まれておらず、ユーザーが初めてアプリケーションを実行したときに、残りのアセットをリモートサーバーからダウンロードするのが一般的です。

アセットローディングメトリクス
インポート