width | 纹理数组的宽度(以像素为单位)。 |
height | 纹理数组的高度(以像素为单位)。 |
depth | 纹理数组元素的数量。 |
linear | 纹理是否包含非颜色数据(即,采样时不进行任何颜色空间转换)?默认为 false。 |
textureFormat | 纹理的格式。 |
mipChain | 是否应该创建多级渐进纹理? |
mipCount | Amount of mips to allocate for the texture array. |
createUninitialized | Use this flag to create the texture with uninitialized data. When overriding all texels anyway, this can lead to improved performance and reduced memory usage. |
mipmapLimitDescriptor | Determines whether the texture uses a mipmap limit, and which mipmap limit to use. See MipmapLimitDescriptor |
创建一个新的纹理数组。
Enable createUninitialized
to make the texture reference uninitialized data (both on the CPU and GPU). When overriding all texels, this can lead to improved performance and reduced memory usage during construction. Note that sampling an uninitialized texture gives unpredictable values.
创建纹理后,通常需要设置其颜色。
使用 SetPixels、SetPixels32 或 Graphics.CopyTexture 函数可进行此设置。
Note that this class does not support Texture2DArray creation with a Crunch compression TextureFormat.
When you enable mipmap limits with a mipmapLimitDescriptor
, a readable CPU copy is required for the texture to reupload when quality settings change. If the texture is made nonreadable (see Texture2DArray.Apply), the uploaded resolution will no longer adapt to the active quality level.