Skip to content

PhysicsLayerRegistry.GetMask Method

Overloads
GetMask(string) Returns the category/collision bit mask for the given layer name. Equivalent to 1UL << GetLayer(name).
GetMask(ReadOnlySpan<string>) Returns the combined mask for multiple named layers. Equivalent to OR-ing GetMask(string) for each name.

PhysicsLayerRegistry.GetMask(string) Method

Returns the category/collision bit mask for the given layer name. Equivalent to 1UL << GetLayer(name).

public ulong GetMask(string name);

Parameters

name System.String

Returns

System.UInt64

Exceptions

System.Collections.Generic.KeyNotFoundException
Thrown when the name has not been registered.

PhysicsLayerRegistry.GetMask(ReadOnlySpan\<string>) Method

Returns the combined mask for multiple named layers. Equivalent to OR-ing GetMask(string) for each name.

public ulong GetMask(params System.ReadOnlySpan<string> names);

Parameters

names System.ReadOnlySpan<System.String>

Returns

System.UInt64

Exceptions

System.Collections.Generic.KeyNotFoundException
Thrown when any name has not been registered.