This commit is contained in:
YangHua 2023-11-17 15:52:07 +08:00
parent b1c54e7f3f
commit fb2d1ef9a5
4 changed files with 19 additions and 4 deletions

View File

@ -724,7 +724,7 @@ public class View_Panel2 : XUIPanel
if (upsd.state) if (upsd.state)
{ {
submitInstruct.text = "提交成功"; submitInstruct.text = "提交成功";
GlobalFlag.practiceSeatId = practiceSeatId;
} }
else else
{ {
@ -733,7 +733,7 @@ public class View_Panel2 : XUIPanel
currentSubjectInfo = await AsyncWebReq.Get<RSData.SubjectInfo>("http://111.229.30.246:48888/Handler/Practice.ashx?action=querypracticeseat&PracticeId=" + currentDIPracticeID + "&PracticeSubjectId=" + currentDISubjectID); currentSubjectInfo = await AsyncWebReq.Get<RSData.SubjectInfo>("http://111.229.30.246:48888/Handler/Practice.ashx?action=querypracticeseat&PracticeId=" + currentDIPracticeID + "&PracticeSubjectId=" + currentDISubjectID);
CreateSubjectInfo(currentSubjectInfo.data); CreateSubjectInfo(currentSubjectInfo.data);
UIBootstrap.Instance.GetSubjectInfo(currentSubjectInfo.data ); UIBootstrap.Instance.GetSubjectInfo(currentSubjectInfo.data);
} }
@ -843,7 +843,21 @@ public class View_Panel2 : XUIPanel
{ {
CreateAllUser(dataItemTemp); CreateAllUser(dataItemTemp);
} }
}
private void OnDisable()
{
Debug.Log("OnDisable");
AdamSync.SyncCreateRoom.createRoomRequset -= OnCreateRoom;
AdamSync.SyncCreateRoom.joinRoomRequset += OnJoinRoom;
AdamSync.SyncCreateRoom.getRoomsRequset += OnGetRooms;
}
private void OnDestory()
{
Debug.Log("OnDestory");
AdamSync.SyncCreateRoom.createRoomRequset -= OnCreateRoom;
AdamSync.SyncCreateRoom.joinRoomRequset -= OnJoinRoom;
AdamSync.SyncCreateRoom.getRoomsRequset -= OnGetRooms;
} }
} }

View File

@ -24,7 +24,7 @@ public class GameManager : MonoBehaviour
spt.gameObject.transform.position = spawnPos.position; spt.gameObject.transform.position = spawnPos.position;
spt.gameObject.transform.eulerAngles = spawnPos.eulerAngles; spt.gameObject.transform.eulerAngles = spawnPos.eulerAngles;
spt.SetPlayerInfo(ulong.Parse(GlobalFlag.currentUser.user_id), GlobalFlag.currentUser.login_name, ulong.Parse(GlobalFlag.roomID), true); spt.SetPlayerInfo(ulong.Parse(GlobalFlag.currentUser.user_id), GlobalFlag.currentUser.login_name, ulong.Parse(GlobalFlag.roomID), true);
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.roomID) == "0") if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) == "0")
{ {
spt.GetComponent<Camera>().cullingMask = ~(1 << 11); spt.GetComponent<Camera>().cullingMask = ~(1 << 11);
} }

View File

@ -46,7 +46,7 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
{ {
for (int i = 0; i < subjectInfo.Count; i++) for (int i = 0; i < subjectInfo.Count; i++)
{ {
if (subjectInfo[i].SeatId == practiceID) if (subjectInfo[i].Id == practiceID)
{ {
return subjectInfo[i].Role; return subjectInfo[i].Role;
} }

View File

@ -7,4 +7,5 @@ public class GlobalFlag
public static UserInfo currentUser; public static UserInfo currentUser;
public static string roomID; public static string roomID;
public static string practiceId; public static string practiceId;
public static string practiceSeatId;
} }