Struct RenderMeshUnmanaged
Defines the mesh and rendering properties of an entity during baking.
Implements
Namespace: Unity.Rendering
Assembly: Unity.Entities.Graphics.dll
Syntax
[Serializable]
public struct RenderMeshUnmanaged : IComponentData, IQueryTypeParameter
Constructors
RenderMeshUnmanaged(UnityObjectRef<Mesh>, UnityObjectRef<Material>, int)
Constructs a RenderMesh using the given Renderer, Mesh, optional list of shared Materials, and option sub-mesh index.
Declaration
public RenderMeshUnmanaged(UnityObjectRef<Mesh> mesh, UnityObjectRef<Material> materialForSubMesh = default, int subMeshIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
UnityObjectRef<Mesh> | mesh | The Mesh to use. |
UnityObjectRef<Material> | materialForSubMesh | The material to use for the given submesh. |
int | subMeshIndex | An options sub-mesh index that represents a sub-mesh in the mesh parameter. |
Fields
materialForSubMesh
A reference to a UnityEngine.Material object.
Declaration
public UnityObjectRef<Material> materialForSubMesh
Field Value
Type | Description |
---|---|
UnityObjectRef<Material> |
Remarks
For efficient rendering, the material should enable GPU instancing. For entities converted from GameObjects, this value is derived from the Materials array of the source Mesh Renderer Component.
mesh
A reference to a UnityEngine.Mesh object.
Declaration
public UnityObjectRef<Mesh> mesh
Field Value
Type | Description |
---|---|
UnityObjectRef<Mesh> |
Methods
Equals(RenderMeshUnmanaged)
Two RenderMesh objects are equal if their respective property values are equal.
Declaration
public bool Equals(RenderMeshUnmanaged other)
Parameters
Type | Name | Description |
---|---|---|
RenderMeshUnmanaged | other | Another RenderMesh. |
Returns
Type | Description |
---|---|
bool | True, if the properties of both RenderMeshes are equal. |
GetHashCode()
A representative hash code.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A number that is guaranteed to be the same when generated from two objects that are the same. |