public int AddBatch (Mesh mesh, int subMeshIndex, Material material, int layer, Rendering.ShadowCastingMode castShadows, bool receiveShadows, bool invertCulling, Bounds bounds, int instanceCount, MaterialPropertyBlock customProps, GameObject associatedSceneObject, ulong sceneCullingMask);

Parámetros

meshThe Mesh to draw.
subMeshIndexSpecifies which subset of the mesh to draw. This applies only to meshes that are composed of several materials.
material Material to use.
layer Layer to use.
castShadowsWhether the meshes cast shadows.
receiveShadowsWhether the meshes receive shadows.
invertCullingSpecify whether to invert the backface culling (true) or not (false). This flag can "flip" the culling mode of all rendered objects. Major use case: rendering reflections for mirrors, water etc. Since virtual camera for rendering the reflection is mirrored, the culling order has to be inverted. You can see how the Water script in Effects standard package does that.
bounds Bounds to use. Should specify the combined bounds of all the instances.
instanceCountThe number of instances to draw.
customPropsAdditional material properties to apply. See MaterialPropertyBlock.
associatedSceneObjectThe GameObject to select when you pick an object that the batch renders.
sceneCullingMaskAdditional culling mask usually used for scene based culling. See Also: EditorSceneManager.GetSceneCullingMask.

Valor de retorno

int The batch's index in the BatchedRendererGroup.

Descripción

Adds a new batch to the group.

Each batch corresponds to a new draw call. As long as the batch is not removed and the group is not disposed of, the command is persistent and doesn't need to be called every frame. Returns the batch's index within the group.