BoxMesh
Procedural box with independent dimensions and subdivisions.
BoxMesh defines a single box surface centered on the local origin. Size gives full dimensions; SubdivideWidth/Height/Depth add segments along X/Y/Z. Subdivision does not round the box. Instances sharing one resource share its changes.
Enable AddUV2 and follow the LightmapGI guide for baked lighting. Material and UV2 settings are inherited from PrimitiveMesh; configure collision separately when needed.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
BoxMeshConstructor
public BoxMesh();Creates a 1×1×1 box with zero additional subdivisions. Its single surface uses 24 vertices for separate face normals/UVs and 12 triangles. Inherited AddUV2 defaults to false. This is a visual geometry resource, not a complete physics body.
Properties4
SizeProperty
public Vector3 Size { get; set; }Full local dimensions along X, Y and Z; defaults to (1, 1, 1). Geometry is centered at the origin, with positive-size bounds from −Size/2 to +Size/2. This is not instance Scale. Use finite positive dimensions: the setter does not sanitize arbitrary input. Changing size updates the mesh and, with AddUV2, the lightmap size hint.
SubdivideDepthProperty
public int SubdivideDepth { get; set; }Additional subdivisions along Z, default 0. Negative values are stored as 0. The corresponding faces have value + 1 segments along that axis. Bounds remain unchanged and faces are not rounded; more subdivisions mean more geometry, not beveled edges. Changes automatically regenerate the mesh.
SubdivideHeightProperty
public int SubdivideHeight { get; set; }Additional subdivisions along Y, default 0. Negative values are stored as 0. The corresponding faces have value + 1 segments along that axis. Bounds remain unchanged and faces are not rounded; more subdivisions mean more geometry, not beveled edges. Changes automatically regenerate the mesh.
SubdivideWidthProperty
public int SubdivideWidth { get; set; }Additional subdivisions along X, default 0. Negative values are stored as 0. The corresponding faces have value + 1 segments along that axis. Bounds remain unchanged and faces are not rounded; more subdivisions mean more geometry, not beveled edges. Changes automatically regenerate the mesh.
Methods8
GetSizeVector3
public Vector3 GetSize();Returns Size. Full local dimensions along X, Y and Z; defaults to (1, 1, 1). Geometry is centered at the origin, with positive-size bounds from −Size/2 to +Size/2. This is not instance Scale. Use finite positive dimensions: the setter does not sanitize arbitrary input. Changing size updates the mesh and, with AddUV2, the lightmap size hint.
Vector3Current Size in the mesh resource.
GetSubdivideDepthint
public int GetSubdivideDepth();Returns SubdivideDepth. Additional subdivisions along Z, default 0. Negative values are stored as 0. The corresponding faces have value + 1 segments along that axis. Bounds remain unchanged and faces are not rounded; more subdivisions mean more geometry, not beveled edges. Changes automatically regenerate the mesh.
intCurrent SubdivideDepth in the mesh resource.
GetSubdivideHeightint
public int GetSubdivideHeight();Returns SubdivideHeight. Additional subdivisions along Y, default 0. Negative values are stored as 0. The corresponding faces have value + 1 segments along that axis. Bounds remain unchanged and faces are not rounded; more subdivisions mean more geometry, not beveled edges. Changes automatically regenerate the mesh.
intCurrent SubdivideHeight in the mesh resource.
GetSubdivideWidthint
public int GetSubdivideWidth();Returns SubdivideWidth. Additional subdivisions along X, default 0. Negative values are stored as 0. The corresponding faces have value + 1 segments along that axis. Bounds remain unchanged and faces are not rounded; more subdivisions mean more geometry, not beveled edges. Changes automatically regenerate the mesh.
intCurrent SubdivideWidth in the mesh resource.
SetSizevoid
public void SetSize(Vector3 size);Sets Size. Full local dimensions along X, Y and Z; defaults to (1, 1, 1). Geometry is centered at the origin, with positive-size bounds from −Size/2 to +Size/2. This is not instance Scale. Use finite positive dimensions: the setter does not sanitize arbitrary input. Changing size updates the mesh and, with AddUV2, the lightmap size hint.
| Name | Type | Default |
|---|---|---|
size | Vector3 | — |
sizeNew Size value, applied to the resource rather than one instance.
SetSubdivideDepthvoid
public void SetSubdivideDepth(int divisions);Sets SubdivideDepth. Additional subdivisions along Z, default 0. Negative values are stored as 0. The corresponding faces have value + 1 segments along that axis. Bounds remain unchanged and faces are not rounded; more subdivisions mean more geometry, not beveled edges. Changes automatically regenerate the mesh.
| Name | Type | Default |
|---|---|---|
divisions | int | — |
divisionsNew SubdivideDepth value, applied to the resource rather than one instance.
SetSubdivideHeightvoid
public void SetSubdivideHeight(int divisions);Sets SubdivideHeight. Additional subdivisions along Y, default 0. Negative values are stored as 0. The corresponding faces have value + 1 segments along that axis. Bounds remain unchanged and faces are not rounded; more subdivisions mean more geometry, not beveled edges. Changes automatically regenerate the mesh.
| Name | Type | Default |
|---|---|---|
divisions | int | — |
divisionsNew SubdivideHeight value, applied to the resource rather than one instance.
SetSubdivideWidthvoid
public void SetSubdivideWidth(int subdivide);Sets SubdivideWidth. Additional subdivisions along X, default 0. Negative values are stored as 0. The corresponding faces have value + 1 segments along that axis. Bounds remain unchanged and faces are not rounded; more subdivisions mean more geometry, not beveled edges. Changes automatically regenerate the mesh.
| Name | Type | Default |
|---|---|---|
subdivide | int | — |
subdivideNew SubdivideWidth value, applied to the resource rather than one instance.