# IsAttached()

> Returns true if running via PIX and in a development build.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Rendering](/engine/6000.7/script-reference/unityengine/rendering.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static bool IsAttached()
```

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) |             |

### Examples

```csharp
using UnityEngine;
using UnityEngine.Rendering;

public class PixControl : MonoBehaviour
{
    public int frameCaptureCount = 1;

    int frameCount = 0;
    bool capturing = false;

    void Awake()
    {
        if (PIX.IsAttached())
        {
            PIX.BeginGPUCapture();
            capturing = true;
        }
    }

    void Update()
    {
        if (frameCount > frameCaptureCount && capturing)
        {
            PIX.EndGPUCapture();
            capturing = false;
        }

        frameCount++;
    }
}
```
