roomId设为全局变量

This commit is contained in:
lq 2024-12-25 17:24:22 +08:00
parent 0cc4f10ed1
commit 9df67ea1d6
2 changed files with 6 additions and 1 deletions

View File

@ -31,7 +31,10 @@ public class gameRoomReserve : MonoBehaviour
Debug.Log("预定演练" + response); Debug.Log("预定演练" + response);
// 解析服务器返回的数据 // 解析服务器返回的数据
ScheduledDrillResponse scheduledDrillResponse = JsonConvert.DeserializeObject<ScheduledDrillResponse>(response); ScheduledDrillResponse scheduledDrillResponse = JsonConvert.DeserializeObject<ScheduledDrillResponse>(response);
Debug.Log(scheduledDrillResponse.data); //存静态
GlobalData.scheduledDrillResponse = scheduledDrillResponse;
Debug.Log("这个不是是静态的" + scheduledDrillResponse.data);
Debug.Log("现在是静态的"+GlobalData.scheduledDrillResponse.data);
return scheduledDrillResponse; return scheduledDrillResponse;
} }
} }

View File

@ -6,6 +6,7 @@ public class MyGlobal : Global
{ {
public static MyGlobal global; public static MyGlobal global;
public loginResponse loginResponse; public loginResponse loginResponse;
//public ScheduledDrillResponse scheduledDrillResponse;
private void Start() private void Start()
{ {
@ -68,6 +69,7 @@ public static class GlobalData
{ {
// 静态变量用于存储登录响应数据 // 静态变量用于存储登录响应数据
public static loginResponse ServerData; public static loginResponse ServerData;
public static ScheduledDrillResponse scheduledDrillResponse;
} }
//==================================================== //====================================================
//public class TemplateListData: Response //public class TemplateListData: Response