Version: 2021.3
言語: 日本語
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. Click GameObject > Effects > Particle System.
  2. In the Inspector, find the Particle System component.
  3. In the Particle System component, find the Custom Data module fold-out.
  4. To the left of the fold-out header, enable the checkbox.

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.unity.cn/2017.2/Documentation/Manual/30_search.html?q=newin20172) で追加NewIn20172
Trails モジュール
Renderer モジュール
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961