1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using LitJson;
- using SC.XR.Unity;
- using UnityEngine;
- using XRTool.Util;
- public class GameStart : UnitySingleton<GameStart>
- {
- public static Action actionok;
- public SystemFollow systemMenu;
- protected override void Awake()
- {
- base.Awake();
- GameObject systemMenuObj = Resources.Load("systemMenu") as GameObject;
- systemMenuObj = Instantiate(systemMenuObj);
- systemMenu = systemMenuObj.transform.GetComponent<SystemFollow>();
- systemMenu.InitUI();
- }
- // Start is called before the first frame update
- void Start()
- {
- //if (TimerMgr.Instance)
- //{
- // TimerMgr.Instance.CreateTimer(() =>
- // {
- // API_GSXR_Slam.GSXR_Set_TrackMode(TrackMode.Mode_3Dof);
- // }, 1f);
- //}
- actionok += ShowDating;
- WSHandler.Office.OnInvitee += Invitee;
- ScenesManager.Instance.showWindow(ScenesManager.SceneType.GameStartLogo);
- }
- private void Invitee(JsonData data)
- {
- WSHandler.Office.ChangeUserType(UserInfo.BusyType);
- string peerId = data["data"]["peerId"].ToString();
- string nickName = data["data"]["nickName"].ToString();
- string roomId = data["data"]["roomId"].ToString();
- string avatar = data["data"]["avatar"].ToString();
- PopUpInfo.Instance.showPublic(PopUpInfo.PopType.ListenDlg);
- if (ListenDlg.Instance)
- {
- ListenDlg.Instance.Init(peerId, roomId, nickName, avatar, true);
- }
- }
- public void ShowDating()
- {
- if (JoinRoom.Instance != null)
- {
- JoinRoom.Instance.showOffice();
- }
- }
- protected override void OnDestroy()
- {
- base.OnDestroy();
- actionok -= ShowDating;
- WSHandler.Office.OnInvitee -= Invitee;
- }
- }
|