import { DEBUG } from "cc/env";
import { Tips } from "./Tips";
import { find } from "cc";

export class DebugM {
  isOpenPlayGame() {
    // return this.isDebugPeople();
    return true;
  }
  isOpenFamily() {
    return true;
  }
  private static _ins: DebugM;
  public static get ins(): DebugM {
    return this._ins ?? (this._ins = new DebugM());
  }

  public setDebugPeople() {
    localStorage.setItem("debug_people", "1");
    this.intoDebugMode();
  }

  init() {
    if (this.isDebugPeople()) {
      this.intoDebugMode();
    }
  }

  public intoDebugMode() {
    new window["VConsole"]();
    Tips.show("Debug Mode");
  }

  public isDebugPeople() {
    return localStorage.getItem("debug_people") == "1";
  }
}
