StartProject.cs 946 B

12345678910111213141516171819202122232425262728293031323334
  1. using LitJson;
  2. using SUIFW;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using UnityEngine;
  6. public class StartProject : BaseUIForms
  7. {
  8. // Start is called before the first frame update
  9. void Start()
  10. {
  11. WSHandler.Office.OnInvitee += Invitee;
  12. ShowUIForms(SysConst.StarAppForms);
  13. }
  14. private void Invitee(JsonData data)
  15. {
  16. WSHandler.Office.ChangeUserType(UserInfo.BusyType);
  17. string peerId = data["data"]["peerId"].ToString();
  18. string nickName = data["data"]["nickName"].ToString();
  19. string roomId = data["data"]["roomId"].ToString();
  20. string avatar = data["data"]["avatar"].ToString();
  21. ShowUIForms(SysConst.ListenForms);
  22. if (ListenForms.Instance)
  23. {
  24. ListenForms.Instance.Init(peerId, roomId, nickName, avatar, true);
  25. }
  26. }
  27. private void OnDestroy()
  28. {
  29. WSHandler.Office.OnInvitee -= Invitee;
  30. }
  31. }