# PhysicsComposer.Operation

> A composer operation.

## Definition

* **Type:** Enum
* **Namespace:** [Unity.U2D.Physics](/engine/6000.7/script-reference/unity/u2d/physics.md)
* **Assembly:** UnityEngine.PhysicsCore2DModule

```csharp
public enum PhysicsComposer.Operation
```

## Remarks

Pass an operation into [PhysicsComposer.AddLayer](/engine/6000.7/script-reference/unity/u2d/physics/physicscomposer/addlayer.md) to control how each new layer combines with the layers already added to the [PhysicsComposer](/engine/6000.7/script-reference/unity/u2d/physics/physicscomposer.md). `OR` adds the shape, `AND` keeps only the areas where the new shape and the existing shapes overlap, `NOT` subtracts the new shape from the existing shapes, and `XOR` removes overlapping areas but keeps the non-overlapping areas.

## Examples

```csharp
// Add a circle layer, then subtract a capsule layer from it.
using UnityEngine;
using Unity.Collections;
using Unity.U2D.Physics;

public class ComposerOperationExample : MonoBehaviour
{
    public CircleGeometry circleGeometry = CircleGeometry.defaultGeometry;
    public CapsuleGeometry capsuleGeometry = CapsuleGeometry.defaultGeometry;

    void Start()
    {
        PhysicsComposer composer = PhysicsComposer.Create(Allocator.Temp);
        composer.AddLayer(circleGeometry, PhysicsTransform.identity, PhysicsComposer.Operation.OR);
        composer.AddLayer(capsuleGeometry, PhysicsTransform.identity, PhysicsComposer.Operation.NOT);

        // Destroy the composer to also destroy the temporary allocator.
        composer.Destroy();
    }
}
```

## Fields

| Value                                                                                     | Description                                        |
| ----------------------------------------------------------------------------------------- | -------------------------------------------------- |
| [AND](/engine/6000.7/script-reference/unity/u2d/physics/physicscomposer/operation/and.md) | Perform an AND operation (geometric intersection). |
| [NOT](/engine/6000.7/script-reference/unity/u2d/physics/physicscomposer/operation/not.md) | Perform a NOT operation (geometric difference).    |
| [OR](/engine/6000.7/script-reference/unity/u2d/physics/physicscomposer/operation/or.md)   | Perform an OR operation (geometric merge).         |
| [XOR](/engine/6000.7/script-reference/unity/u2d/physics/physicscomposer/operation/xor.md) | Perform an XOR operation (geometric flip).         |
