如果正在通过 PIX 运行并处于开发构建中,则返回 true。
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++; } }