diff --git a/TheStrongestSnail/Assets/Scenes/Battle_Royale.unity b/TheStrongestSnail/Assets/Scenes/Battle_Royale.unity index fab9dfc..4f01436 100644 --- a/TheStrongestSnail/Assets/Scenes/Battle_Royale.unity +++ b/TheStrongestSnail/Assets/Scenes/Battle_Royale.unity @@ -1966,6 +1966,7 @@ MonoBehaviour: timeText: {fileID: 1632850612} timeNum: 0 carrySeconds: 0 + InfoObject: {fileID: 2127674355} --- !u!1 &270479495 GameObject: m_ObjectHideFlags: 0 @@ -10441,12 +10442,12 @@ GameObject: - component: {fileID: 2127674359} - component: {fileID: 2127674360} m_Layer: 5 - m_Name: GameObject + m_Name: InfoObject m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &2127674356 RectTransform: m_ObjectHideFlags: 0 @@ -10479,6 +10480,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 48ec9b444797b3d4d93d6d2c1bb4299b, type: 3} m_Name: m_EditorClassIdentifier: + token: updateUserInfo: {fileID: 0} sec: 0 --- !u!114 &2127674358 diff --git a/TheStrongestSnail/Assets/Scripts/Battle_Royale/EggNum.cs b/TheStrongestSnail/Assets/Scripts/Battle_Royale/EggNum.cs index 0dbbda2..a9eec20 100644 --- a/TheStrongestSnail/Assets/Scripts/Battle_Royale/EggNum.cs +++ b/TheStrongestSnail/Assets/Scripts/Battle_Royale/EggNum.cs @@ -8,7 +8,7 @@ public class EggNum : MonoBehaviour public Text eggNumText; public static EggNum instance; // Start is called before the first frame update - void Start() + void Awake() { instance = this; diff --git a/TheStrongestSnail/Assets/Scripts/Battle_Royale/HegemonTime.cs b/TheStrongestSnail/Assets/Scripts/Battle_Royale/HegemonTime.cs index 7c25367..5df69eb 100644 --- a/TheStrongestSnail/Assets/Scripts/Battle_Royale/HegemonTime.cs +++ b/TheStrongestSnail/Assets/Scripts/Battle_Royale/HegemonTime.cs @@ -9,7 +9,7 @@ public class HegemonTime : MonoBehaviour public Text timeText; public int timeNum; public int carrySeconds; - + public GameObject InfoObject; // Start is called before the first frame update void Start() { @@ -22,6 +22,7 @@ public class HegemonTime : MonoBehaviour private void Update() { + Debug.Log("carrySeconds:" + InfoObject.GetComponent().carrySeconds); } public IEnumerator StartGame() diff --git a/TheStrongestSnail/Assets/Scripts/Login/UI/logoPanel.cs b/TheStrongestSnail/Assets/Scripts/Login/UI/logoPanel.cs index 29e5aa5..b688c0c 100644 --- a/TheStrongestSnail/Assets/Scripts/Login/UI/logoPanel.cs +++ b/TheStrongestSnail/Assets/Scripts/Login/UI/logoPanel.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.Networking; +using UnityEngine.SceneManagement; using static LoginAndGetToken; @@ -74,6 +75,10 @@ public class logoPanel : MonoBehaviour { string registerResponse = webRequest.downloadHandler.text; Debug.Log("Register Response: " + registerResponse); + + SceneManager.LoadScene(1); + + // 可在此处解析注册响应并进行后续处理 // 比如解析返回的token并触发事件 } diff --git a/TheStrongestSnail/Assets/Scripts/Login/selectGameEscape512.cs b/TheStrongestSnail/Assets/Scripts/Login/selectGameEscape512.cs index ab04bc6..5eed136 100644 --- a/TheStrongestSnail/Assets/Scripts/Login/selectGameEscape512.cs +++ b/TheStrongestSnail/Assets/Scripts/Login/selectGameEscape512.cs @@ -135,10 +135,12 @@ using System.Threading.Tasks; public class selectGameEscape512 : MonoBehaviour { - public static selectGameEscape512 instance; + public int gameEscapeId; public int carrySeconds; + + // 定义一个事件,当 gameEscapeId 被更新时触发 public static event Action OnGameEscapeIdUpdated; @@ -146,7 +148,7 @@ public class selectGameEscape512 : MonoBehaviour void Start() { - instance = this; + // 监听登录获取 token LoginAndGetToken.OnTokenReceived += HandleTokenReceived;