UserMgr.ts 592 B

12345678910111213141516171819
  1. import { Node, Prefab, _decorator, assetManager, find, instantiate, sys } from 'cc';
  2. import { UserModel } from '../Model/UserModel';
  3. const { ccclass, property } = _decorator;
  4. @ccclass('UserManager')
  5. export class UserManager {
  6. private static _instance: UserManager | null = null;
  7. public static get instance(): UserManager {
  8. if (!this._instance) this._instance = new UserManager();
  9. return this._instance;
  10. }
  11. public userModel: UserModel = null;
  12. initilizeModel(): void {
  13. this.userModel = new UserModel();
  14. this.userModel.initialize();
  15. }
  16. }