Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

PhysicsShape.SetSurfaceMaterial

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static int SetSurfaceMaterial(ReadOnlySpan<PhysicsShape> shapes, ReadOnlySpan<SurfaceMaterial> surfaceMaterials);

Parameters

Parameter Description
shapes The shapes to set the surface material on.
surfaceMaterials The surface materials to set, one entry per shape.

Returns

int The number of shapes that were ignored (not set because the shape was invalid). A single warning is logged when any are ignored. If the spans are different lengths, nothing is set and every shape is counted as ignored.

Description

Set the SurfaceMaterial on a batch of shapes. The shapes and surfaceMaterials spans must be the same length; shapes[n] receives surfaceMaterials[n].


Declaration

public static int SetSurfaceMaterial(ReadOnlySpan<PhysicsShape> shapes, SurfaceMaterial surfaceMaterial);

Parameters

Parameter Description
shapes The shapes to set the surface material on.
surfaceMaterial The surface material to set on every shape.

Returns

int The number of shapes that were ignored (not set because the shape was invalid). A single warning is logged when any are ignored.

Description

Set the same SurfaceMaterial on a batch of shapes.