diff --git a/Assets/Temp/Scripts/View_Panel2.cs b/Assets/Temp/Scripts/View_Panel2.cs index 1f723d83..b90dadf6 100644 --- a/Assets/Temp/Scripts/View_Panel2.cs +++ b/Assets/Temp/Scripts/View_Panel2.cs @@ -724,7 +724,7 @@ public class View_Panel2 : XUIPanel if (upsd.state) { submitInstruct.text = "提亀成功"; - + GlobalFlag.practiceSeatId = practiceSeatId; } else { @@ -733,7 +733,7 @@ public class View_Panel2 : XUIPanel currentSubjectInfo = await AsyncWebReq.Get("http://111.229.30.246:48888/Handler/Practice.ashx?action=querypracticeseat&PracticeId=" + currentDIPracticeID + "&PracticeSubjectId=" + currentDISubjectID); CreateSubjectInfo(currentSubjectInfo.data); - UIBootstrap.Instance.GetSubjectInfo(currentSubjectInfo.data ); + UIBootstrap.Instance.GetSubjectInfo(currentSubjectInfo.data); } @@ -843,7 +843,21 @@ public class View_Panel2 : XUIPanel { 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; } } diff --git a/Assets/Zion/Scripts/Adam/GameManager.cs b/Assets/Zion/Scripts/Adam/GameManager.cs index e5fe245d..09dca1d2 100644 --- a/Assets/Zion/Scripts/Adam/GameManager.cs +++ b/Assets/Zion/Scripts/Adam/GameManager.cs @@ -24,7 +24,7 @@ public class GameManager : MonoBehaviour spt.gameObject.transform.position = spawnPos.position; spt.gameObject.transform.eulerAngles = spawnPos.eulerAngles; 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().cullingMask = ~(1 << 11); } diff --git a/Assets/Zion/Scripts/Adam/UIBootstrap.cs b/Assets/Zion/Scripts/Adam/UIBootstrap.cs index e09be6a1..2f64900f 100644 --- a/Assets/Zion/Scripts/Adam/UIBootstrap.cs +++ b/Assets/Zion/Scripts/Adam/UIBootstrap.cs @@ -46,7 +46,7 @@ public class UIBootstrap : MonoSingleton { for (int i = 0; i < subjectInfo.Count; i++) { - if (subjectInfo[i].SeatId == practiceID) + if (subjectInfo[i].Id == practiceID) { return subjectInfo[i].Role; } diff --git a/Assets/Zion/Scripts/Adam/Utility/GlobalFlag.cs b/Assets/Zion/Scripts/Adam/Utility/GlobalFlag.cs index 7138c8ad..9de403ef 100644 --- a/Assets/Zion/Scripts/Adam/Utility/GlobalFlag.cs +++ b/Assets/Zion/Scripts/Adam/Utility/GlobalFlag.cs @@ -7,4 +7,5 @@ public class GlobalFlag public static UserInfo currentUser; public static string roomID; public static string practiceId; + public static string practiceSeatId; }