This commit is contained in:
账号名 2024-01-29 21:50:52 +08:00
commit b1379f43f4
3 changed files with 9 additions and 11 deletions

View File

@ -189,7 +189,7 @@ public class GameManager : MonoSingleton<GameManager>
spt.GetComponent<Camera>().cullingMask = TeacherLayer;
}
//spt.GetComponent<Camera>().cullingMask &= ~(1 << 15);
AdamSync.SyncCreateRoom.send2worldRequset += OnGetWorldInfo;
tenkokuModule.mainCamera = spt.transform;
AddPlayers(spt);
DeviceManager.Instance.OnInit();
@ -206,7 +206,11 @@ public class GameManager : MonoSingleton<GameManager>
_ = SyncCreateRoom.SendMessageAsync(msg);
}
public void OnGetWorldInfo(string msg)
{
Debug.Log("OnGetWorldInfo====" + msg);
RemovePlayer(ulong.Parse(msg));
}
private void Update()
{
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) == "0" && Input.GetMouseButtonDown(0))
@ -382,8 +386,6 @@ public class GameManager : MonoSingleton<GameManager>
public async void CheckRoomState()
{
RoomState roomState = await AsyncWebReq.Post<RoomState>(Url_UpdateRoomState + GlobalFlag.roomID + "&state=1", null);
Debug.Log($"<color=red>GamemanagerRoomState={ roomState.message}</color>");
if (roomState.message == "success")
{
GlobalFlag.isStartRehearsing = true;
@ -572,6 +574,7 @@ public class GameManager : MonoSingleton<GameManager>
{
SyncCreateRoom.getroomusersRequset -= OnGetRoomUsers;
SyncCreateRoom.send2roomRequset -= OnRoomInfo;
SyncCreateRoom.send2worldRequset -= OnGetWorldInfo;
//string _msg = "leaveroom ";
//_ = AdamSync.SyncCreateRoom.SendMessageAsync(_msg);
}

View File

@ -31,7 +31,7 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
traininginformations.Add(t);
}
AdamSync.SyncCreateRoom.leaveRoomRequset += OnLeaveRoomInfo;
AdamSync.SyncCreateRoom.send2worldRequset += OnGetWorldInfo;
}
@ -115,11 +115,7 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
return false;
}
public void OnGetWorldInfo(string msg)
{
Debug.Log("OnGetWorldInfo====" + msg);
GameManager.Instance.RemovePlayer(ulong.Parse(msg));
}
public void OnLeaveRoomInfo(string msg)
{

View File

@ -56,7 +56,6 @@ namespace AdamSync
private void OnDisable()
{
Debug.Log("1212");
SyncCreateRoom.CloseClint();
isLinkAgain = false;
}