Version: 2017.2

MaterialPropertyBlock

class in UnityEngine

マニュアルに切り替える

説明

マテリアル情報を適用するブロック要素を作成します。

MaterialPropertyBlock is used by Graphics.DrawMesh and Renderer.SetPropertyBlock. Use it in situations where you want to draw multiple objects with the same material, but slightly different properties. For example, if you want to slightly change the color of each mesh drawn. Changing the render state is not supported.

Unity's terrain engine uses MaterialPropertyBlock to draw trees; all of them use the same material, but each tree has different color, scale & wind factor.

The block passed to Graphics.DrawMesh or Renderer.SetPropertyBlock is copied, so the most efficient way of using it is to create one block and reuse it for all DrawMesh calls. Use SetFloat, SetVector, SetColor, SetMatrix, SetTexture, SetBuffer to add or replace values.

See Also: Graphics.DrawMesh, Material.

変数

isEmptyMaterialPropertyBlock が空かどうか (読み込み専用)

Public 関数

Clear設定したマテリアルプロパティーをすべて削除します。
GetFloatプロパティーブロックから float を取得します
GetFloatArrayGet a float array from the property block.
GetMatrixプロパティーブロックから matrix を取得します
GetMatrixArrayGet a matrix array from the property block.
GetTextureプロパティーブロックから texture を取得します
GetVectorプロパティーブロックから vector を取得します。
GetVectorArrayGet a vector array from the property block.
SetBuffer ComputeBuffer プロパティーを設定します。
SetColorcolor 型のプロパティーを設定します
SetFloatfloat 型のプロパティーを設定します
SetFloatArrayfloat 配列のプロパティーを設定します。
SetMatrixMatrix4x4 型のプロパティーを設定します
SetMatrixArrayMatrix 配列プロパティーを設定します。
SetTextureTexture 型のプロパティーを設定します
SetVectorvector 型のプロパティーを設定します
SetVectorArrayベクトル配列プロパティーを設定します。
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961