Version: 2022.2
言語: 日本語
Trails モジュール
Renderer モジュール

Custom Data モジュール

Custom Data モジュールを使うと、パーティクルにアタッチするカスタムのデータ形式をエディターで定義できます。これをスクリプトで設定することもできます。スクリプトでカスタムデータを設定し、そのデータをシェーダーにフィードする方法の詳細は パーティクルシステム頂点ストリーム を参照してください。

データは、最大 4 つの MinMaxCurve コンポーネント、または、Color (HDR が有効な MinMaxGradient ) をもつ Vector 形式です。このデータを使って、スクリプトとシェーダーのカスタムロジックを操作します。

各カーブ/グラデーションのデフォルトのラベルは、クリックして働きを示す名を入力してカスタマイズできます。カスタムデータをシェーダーに渡すとき、そのデータがシェーダー内でどのように使われているかを知ることは大切です。例えば、カーブがカスタムアルファテストに使用されたり、グラデーションがパーティクルに補助的な色を加えるために使用されているのかもしれません。ラベルを編集することにより、簡単に各カスタムデータエントリーを UI に記録することができます。

Using the Custom Data module

This module is part of the Particle System component. When you create a new Particle System GameObject, or add a Particle System component to an exiting GameObject, Unity adds the Custom Data module to the Particle System. By default, Unity disables this module. To create a new Particle System and enable this module:

  1. GameObject > Effects > Particle System をクリックします。
  2. Inspector 内で Particle System コンポーネントを見つけます。
  3. In the Particle System component, find the Custom Data module fold-out.
  4. 折り畳みメニューのヘッダーの左側にあるチェックボックスを有効にします。

API

Since this module is part of the Particle System component, you access it through the ParticleSystem class. For information on how to access it and change values at runtime, see the Custom Data module API documentation.

  • 2017–09–04 修正されたページ
  • 編集可能なデータラベルは Unity [2017.2] で追加(https://docs.unity3d.com/2017.2/Documentation/Manual/30_search.html?q=newin20172) で追加NewIn20172
Trails モジュール
Renderer モジュール