import { onStart, OrbitControls } from "@needle-tools/engine";

/**
 * Turn off orbit / pan / zoom from the exported scene.
 * `<needle-engine camera-controls="false">` only skips auto-injected controls; Unity-serialized ones
 * must be disabled in code.
 */
onStart((context) => {
  const oc = context.scene.getComponentInChildren(OrbitControls);
  if (!oc) return;

  oc.enableRotate = false;
  oc.enablePan = false;
  oc.enableZoom = false;
  oc.enableKeys = false;
  oc.autoRotate = false;
  oc.middleClickToFocus = false;
  oc.doubleClickToFocus = false;
  oc.clickBackgroundToFitScene = 0;

  const three = oc.controls;
  if (three) {
    three.enabled = false;
  }

  oc.enabled = false;
});
