Modifier

Partager via


GameObjectExtensions.IsInLayerMask(GameObject, LayerMask) Method

Definition

Determines whether or not a game object's layer is included in the specified layer mask.

public:
[System::Runtime::CompilerServices::Extension]
 static bool IsInLayerMask(UnityEngine::GameObject ^ gameObject, UnityEngine::LayerMask layerMask);
public static bool IsInLayerMask (this UnityEngine.GameObject gameObject, UnityEngine.LayerMask layerMask);
static member IsInLayerMask : UnityEngine.GameObject * UnityEngine.LayerMask -> bool
<Extension()>
Public Function IsInLayerMask (gameObject As GameObject, layerMask As LayerMask) As Boolean

Parameters

gameObject
UnityEngine.GameObject

The game object whose layer to test.

layerMask
UnityEngine.LayerMask

The layer mask to test against.

Returns

True if gameObject's layer is included in layerMask, false otherwise.

Applies to