UserComp.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. /* Socket组件-用户 */
  5. public class UserComp : JCUnityLib.Singleton<UserComp>
  6. {
  7. public void getUserInfo(System.Action<UserInfo> cb) {
  8. UserPlayer.ins.call("userComp.getUserInfo", null, cb);
  9. }
  10. public void saveUserInfo(UserInfo userInfo) {
  11. UserPlayer.ins.call("userComp.saveUserInfo", userInfo);
  12. }
  13. public void saveMac2()
  14. {
  15. string mac = LoginMgr.myUserInfo.mac;
  16. if (string.IsNullOrEmpty(mac)) return;
  17. int type = AimHandler.DeviceType;
  18. UserPlayer.ins.call("userComp.saveMac2", mac, type);
  19. }
  20. public void saveCalibrateRecord(string record) {
  21. string mac = LoginMgr.myUserInfo.mac;
  22. if (string.IsNullOrEmpty(mac)) return;
  23. int type = AimHandler.DeviceType;
  24. UserPlayer.ins.call("userComp.saveCalibrateRecord", type, record, mac);
  25. }
  26. #region 被服务端调用的函数
  27. public void onResumeCalibrateRecord(string record) {
  28. AimHandler.ins.ResumeCalibrateRecord(record);
  29. }
  30. #endregion
  31. }