MKSystem.ts 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import BuglySDK from "../sdk/BuglySDK";
  2. import FileUtil from "../utils/FileUtil";
  3. import TimeUtil from "../utils/TimeUtil";
  4. import DataSystem from "./DataSystem";
  5. import HttpSystem from "./HttpSystem";
  6. import LoadResUtil from "../utils/LoadResUtil";
  7. import LogUtil from "../utils/LogUtil";
  8. import { EncryptUtil } from "../utils/EncryptUtil";
  9. import GameUtil from "../utils/GameUtil";
  10. import UISystem from "./UISystem";
  11. import StorageUtil from "../utils/StorageUtil";
  12. import TimerSystem from "./TimerSystem";
  13. import EventSystem from "./EventSystem";
  14. import MathUtil from "../utils/MathUtil";
  15. import AdSystem from "./AdSystem";
  16. import JsbSystem from "./JsbSystem";
  17. import ATSDKMgr from "../sdk/ad/toppon/AnyThinkAdsMgr/ATSDKMgr";
  18. import AudioSystem from "./AudioSystem";
  19. import TipSystem from "./TipSystem";
  20. import PoolSystem from "./PoolSystem";
  21. /**
  22. * @description mk系统
  23. * @author 邹勇,冯聪,薛鸿潇,kaka
  24. */
  25. class MKSystem {
  26. constructor() {
  27. this.init();
  28. }
  29. /** 工具 */
  30. time: TimeUtil;
  31. file: FileUtil;
  32. encrypt: EncryptUtil;
  33. console: LogUtil;
  34. game: GameUtil;
  35. loader: LoadResUtil;
  36. storage: StorageUtil;
  37. math: MathUtil;
  38. /** SDK */
  39. bugly: BuglySDK;
  40. /** 系统管理 */
  41. data: DataSystem;
  42. ad: AdSystem;
  43. jsb: JsbSystem;
  44. http: HttpSystem;
  45. audio: AudioSystem;
  46. timer: TimerSystem;
  47. event: EventSystem;
  48. pool:PoolSystem;
  49. /** 挂载在MainScene的界面上,不需要new */
  50. ui: UISystem;
  51. tip:TipSystem;
  52. init() {
  53. //工具
  54. this.time = new TimeUtil();
  55. this.file = new FileUtil();
  56. this.encrypt = new EncryptUtil();
  57. this.console = new LogUtil();
  58. this.game = new GameUtil();
  59. this.loader = new LoadResUtil();
  60. this.storage = new StorageUtil();
  61. this.math = new MathUtil();
  62. //sdk
  63. this.bugly = new BuglySDK();
  64. //system
  65. this.data = new DataSystem();
  66. this.http = new HttpSystem();
  67. this.audio = new AudioSystem();
  68. this.ad = new AdSystem(ATSDKMgr.getInstance());
  69. this.jsb = new JsbSystem();
  70. this.timer = new TimerSystem();
  71. this.event = new EventSystem();
  72. this.pool = new PoolSystem();
  73. }
  74. }
  75. declare global {
  76. const mk: MKSystem;
  77. }
  78. window['mk'] = new MKSystem();