Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Create(Allocator)

Create a Physics Composer. NOTE: The composer implements 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, IDisposable will not be called automatically so in this case disposing or simply calling PhysicsComposer.Destroy must be done explicitly.
Read time 1 minuteLast updated 10 days ago

Definition

public static PhysicsComposer Create(Allocator allocator = Allocator.Temp)

Parameters

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

Type

Description

PhysicsComposerThe new Physics Composer.