Version: Unity 6.3 LTS (6000.3)
LanguageEnglish
  • C#

PhysicsComposer.Create

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 LowLevelPhysics2D.PhysicsComposer Create(Unity.Collections.Allocator allocator);

Parameters

Parameter Description
allocator The memory allocator to use when adding layers. It is not used to create the composer itself which must be destroyed. This can only be Allocator.Temp, Allocator.TempJob or Allocator.Persistent.

Returns

PhysicsComposer The new Physics Composer.

Description

Create a Physics Composer. NOTE: The composer implements System.IDisposable which allows you to use the "using" statement on the returned composer object to ensure it's disposed in the current scope which is only useful when using the Allocator.Temp allocator. However, because the composer is a struct, System.IDisposable will not be called automatically so in this case disposing or simply calling PhysicsComposer.Destroy must be done explicitly.