MKSystem.ts 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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 AudioSystem from "./AudioSystem";
  18. import TipSystem from "./TipSystem";
  19. import PoolSystem from "./PoolSystem";
  20. import TweenUtil from "../utils/TweenUtil";
  21. import FlySystem from "./FlySystem";
  22. import GuideSystem from "./GuideSystem";
  23. import StringUtil from "../utils/StringUtil";
  24. import SetGray from "../../game/component/SetGray";
  25. import NumberAnim from "../../game/component/NumberAnim";
  26. import AliRiskManager from "../sdk/aliRisk/AliRiskManager";
  27. import ATSDKMgr from "../sdk/ad/toppon/AnyThinkAdsMgr/ATSDKMgr";
  28. import FlySystem2 from "./FlySystem2";
  29. import ShuzilmM from "../sdk/shuzilm/ShuzilmM";
  30. import TongdunM from "../sdk/tongdun/TongdunM";
  31. /**
  32. * @description mk系统
  33. * @author 邹勇,冯聪,薛鸿潇,kaka
  34. */
  35. class MKSystem {
  36. constructor() {
  37. }
  38. /** 工具 */
  39. private _time: TimeUtil;
  40. public get time(): TimeUtil {
  41. return this._time || (this._time = new TimeUtil());
  42. }
  43. private _file: FileUtil;
  44. public get file(): FileUtil {
  45. return this._file || (this._file = new FileUtil());
  46. }
  47. private _encrypt: EncryptUtil;
  48. public get encrypt(): EncryptUtil {
  49. return this._encrypt || (this._encrypt = new EncryptUtil());
  50. }
  51. private _console: LogUtil;
  52. public get console(): LogUtil {
  53. return this._console || (this._console = new LogUtil());
  54. }
  55. private _game: GameUtil;
  56. public get game(): GameUtil {
  57. return this._game || (this._game = new GameUtil());
  58. }
  59. private _loader: LoadResUtil;
  60. public get loader(): LoadResUtil {
  61. return this._loader || (this._loader = new LoadResUtil());
  62. }
  63. private _storage: StorageUtil;
  64. public get storage(): StorageUtil {
  65. return this._storage || (this._storage = new StorageUtil());
  66. }
  67. private _math: MathUtil;
  68. public get math(): MathUtil {
  69. return this._math || (this._math = new MathUtil());
  70. }
  71. private _string: StringUtil;
  72. public get string(): StringUtil {
  73. return this._string || (this._string = new StringUtil());
  74. }
  75. private _tween: TweenUtil;
  76. public get tween(): TweenUtil {
  77. return this._tween || (this._tween = new TweenUtil())
  78. }
  79. /** SDK */
  80. private _bugly: BuglySDK;
  81. public get bugly(): BuglySDK {
  82. return this._bugly || (this._bugly = new BuglySDK());
  83. }
  84. /** 系统管理 */
  85. private _data: DataSystem;
  86. public get data(): DataSystem {
  87. return this._data || (this._data = new DataSystem());
  88. }
  89. private _ad: AdSystem;
  90. public get ad(): AdSystem {
  91. return this._ad || (this._ad = new AdSystem(ATSDKMgr.getInstance()));
  92. }
  93. private _jsb: JsbSystem;
  94. public get jsb(): JsbSystem {
  95. return this._jsb || (this._jsb = new JsbSystem());
  96. }
  97. private _http: HttpSystem;
  98. public get http(): HttpSystem {
  99. return this._http || (this._http = new HttpSystem());
  100. }
  101. private _audio: AudioSystem;
  102. public get audio(): AudioSystem {
  103. return this._audio || (this._audio = new AudioSystem());
  104. }
  105. private _timer: TimerSystem;
  106. public get timer(): TimerSystem {
  107. return this._timer || (this._timer = new TimerSystem());
  108. }
  109. private _event: EventSystem;
  110. public get event(): EventSystem {
  111. return this._event || (this._event = new EventSystem());
  112. }
  113. private _pool: PoolSystem;
  114. public get pool(): PoolSystem {
  115. return this._pool || (this._pool = new PoolSystem());
  116. }
  117. private _guide: GuideSystem;
  118. public get guide(): GuideSystem {
  119. return this._guide || (this._guide = new GuideSystem());
  120. }
  121. private _aliRiskManager: AliRiskManager;
  122. public get aliRiskManager(): AliRiskManager {
  123. return this._aliRiskManager || (this._aliRiskManager = new AliRiskManager());
  124. }
  125. /** 挂载在MainScene的界面上,不需要new */
  126. private _ui: UISystem;
  127. public get ui(): UISystem {
  128. return this._ui;
  129. }
  130. public set ui(v: UISystem) {
  131. this._ui = v;
  132. }
  133. private _tip: TipSystem;
  134. public get tip(): TipSystem {
  135. return this._tip;
  136. }
  137. public set tip(v: TipSystem) {
  138. this._tip = v;
  139. }
  140. private _fly: FlySystem;
  141. public get fly(): FlySystem {
  142. return this._fly;
  143. }
  144. public set fly(v: FlySystem) {
  145. this._fly = v;
  146. }
  147. private _fly2: FlySystem2;
  148. public get fly2(): FlySystem2 {
  149. return this._fly2;
  150. }
  151. public set fly2(v: FlySystem2) {
  152. this._fly2 = v;
  153. }
  154. /** mk组件类型,此处仅返回类型 */
  155. private _component: comp_type
  156. /** 组件类型 */
  157. public get component(): comp_type {
  158. return this._component || (this._component = new comp_type());
  159. }
  160. private _shuzilmM: ShuzilmM;
  161. public get shuzilmM(): ShuzilmM {
  162. return this._shuzilmM || (this._shuzilmM = new ShuzilmM());
  163. }
  164. private _tongdunM: TongdunM;
  165. public get tongdunM(): TongdunM {
  166. return this._tongdunM || (this._tongdunM = new TongdunM());
  167. }
  168. }
  169. /**
  170. * 组件类型
  171. */
  172. class comp_type {
  173. /** 置灰组件 */
  174. get setGray() {
  175. return SetGray;
  176. }
  177. /** 置灰组件 */
  178. get numberAnim() {
  179. return NumberAnim;
  180. }
  181. }
  182. declare global {
  183. /** 牛逼的梦嘉引擎 */
  184. const mk: MKSystem;
  185. }
  186. window['mk'] = new MKSystem();