Version: 5.6
public Color32[] GetPixels32 (int x, int y, int blockWidth, int blockHeight);

パラメーター

x 取得する四角形の左上隅の X 座標
y 取得する四角形の左上隅の Y 座標
blockWidth 取得する矩形の幅
blockHeight 取得する矩形の高さ ProceduralTexture の四角形からピクセル値を取得して配列に入れ込みます。 ブロックはテクスチャの X、Y オフセットと幅と高さにより指定されます。ブロックは、行に渡りひとつづつピクセル値の読み取りがなされて、平坦化されたうえで配列に入れ込まれす。

説明

ProceduralTexture からピクセル値を取得します

"Readable" としてマーキングされ、テクスチャ形式が RAW である ProceduralMaterial インスタンスでのみ動作します。

The correct sequence to use GetPixels32() is:
- Set the ProceduralMaterial "Readable" flag using ProceduralMaterial.isReadable
- Rebuild the ProceduralMaterial's textures using ProceduralMaterial.RebuildTexturesImmediately
- Call GetPixels32().

See Also: ProceduralMaterial.isReadable, ProceduralMaterial.RebuildTexturesImmediately, Texture2D.GetPixels32.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961