Version: 2021.1
言語: 日本語
public UIElements.MeshWriteData Allocate (int vertexCount, int indexCount, Texture texture);

パラメーター

vertexCount The number of vertices to allocate. The maximum is 65535 (or UInt16.MaxValue).
indexCount The number of triangle list indices to allocate. Each 3 indices represent one triangle, so this value should be multiples of 3.
texture An optional texture to be applied on the triangles allocated. Pass null to rely on vertex colors only.

戻り値

MeshWriteData An object that gives access to the newely allocated data. If the returned vertex count is 0, then allocation failed (the system ran out of memory).

説明

Allocates the specified number of vertices and indices required to express geometry for drawing the content of a VisualElement.

See Vertex.position for details on geometry generation conventions. If a valid texture was passed, then the returned MeshWriteData will also describe a rectangle for the UVs to use to sample the passed texture. This is needed because textures passed to this API can be internally copied into a larger atlas.

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