import { ThreeC } from "./ThreeC";
import { InputC, JoystickC } from "@hitplay/playable_template";

export class TestSceneC {
  static init() {
    this.createMap();

    // example of using InputC events
    InputC.onTouchDown.addDelegate((event) => {
      console.log("onMouseDown", event);
    });

    // if you have update in your controller
    // UpdateController.Instance.onUpdate.addDelegate(() => {
    //   this.update();
    // });
  }

  private static createMap() {
    const map = ThreeC.getObject("map");

    // physics-only collision proxies exported alongside the visual meshes; hide them
    map.traverse((child) => {
      if (/collider/i.test(child.name)) {
        child.visible = false;
      }
    });

    ThreeC.setShadowsStateForChildren(map, true, true);

    ThreeC.addToScene(map);
  }
}
