From 7ff4302abf7bc49572982d71ce21c0326e0732d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BF=97=E5=8B=8B?= <3077614386@qq.com> Date: Mon, 4 Mar 2024 16:55:26 +0800 Subject: [PATCH] 1 --- .../Temp/Scripts/Adam/View_Panel2Attatch.cs | 32 +++++++++++++++++-- Assets/Temp/Scripts/View_Panel2.cs | 21 +++++++++--- Assets/Zion/Scripts/Adam/UIBootstrap.cs | 3 +- .../Zion/Scripts/Adam/Utility/GlobalFlag.cs | 5 +-- .../Scripts/Wzx/SaveVideoToPersistentData.cs | 13 +++++--- Assets/Zion/Scripts/cxx/NetMqListener.cs | 1 + 6 files changed, 62 insertions(+), 13 deletions(-) diff --git a/Assets/Temp/Scripts/Adam/View_Panel2Attatch.cs b/Assets/Temp/Scripts/Adam/View_Panel2Attatch.cs index 6a14f373..b5f0c8b3 100644 --- a/Assets/Temp/Scripts/Adam/View_Panel2Attatch.cs +++ b/Assets/Temp/Scripts/Adam/View_Panel2Attatch.cs @@ -1,10 +1,38 @@ -using System.Collections; +using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.SceneManagement; using UnityEngine.UI; public class View_Panel2Attatch : MonoBehaviour { + public static View_Panel2Attatch view_Panel2Attatch; public GameObject subject; - + //加载 + public GameObject ObjLoadingScene;//加载 + public Slider progressBar;//进度条 + public Text progressDisplay;//进度显示 + + private void Awake() + { + view_Panel2Attatch = this; + } + public IEnumerator Loadscene(string _scence) + { + ObjLoadingScene.SetActive(true); + AsyncOperation operation = SceneManager.LoadSceneAsync(_scence); + operation.allowSceneActivation = false; + while (!operation.isDone) + { + progressBar.value = operation.progress; + progressDisplay.text = "努力加载中..." + operation.progress * 100 + "%"; + if (operation.progress >= 0.9f) + { + progressBar.value = 1; + operation.allowSceneActivation = true; + } + yield return null; + } + } + } diff --git a/Assets/Temp/Scripts/View_Panel2.cs b/Assets/Temp/Scripts/View_Panel2.cs index 0fac6fe0..1b8458fa 100644 --- a/Assets/Temp/Scripts/View_Panel2.cs +++ b/Assets/Temp/Scripts/View_Panel2.cs @@ -6,10 +6,7 @@ using UnityEngine.SceneManagement; using UnityEngine.UI; using XFrame.Core.UI; using RDate; -using UnityEngine.Networking; -using System.Threading; using static InterfaceManager; - [Serializable] public class ReturnRoomID { @@ -93,6 +90,7 @@ public class View_Panel2 : XUIPanel public Button entering_key_btn;//进入导调按钮 public Button scenario_btn;//想定编辑 public Button refresh_btn;//刷新房间按钮 + public View_Panel2() : base(UIType.Normal, UIMode.HideOther, UICollider.Normal) { uiPath = "UIPanel/View_Panel2"; @@ -158,6 +156,8 @@ public class View_Panel2 : XUIPanel jobInputField = selector_panl.transform.Find("JobInputField").GetComponent(); userItem = userConent.GetChild(0).gameObject; thinkingDropdown.options.Clear(); + + tijiao_btn.onClick.AddListener(() => { if (!string.IsNullOrEmpty(currentAccount)) @@ -263,8 +263,20 @@ public class View_Panel2 : XUIPanel //Debug.Log("OnJoinRoom ViewPanel===" + msg); //Debug.Log("订阅"+); MyNetMQClient.instance._netMqListener.SubTopic(GlobalFlag.roomID); - SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1"); + if (GlobalFlag.field_Char1 == "学校") + { + SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 1"); + //CoroutineHandler.StartCoroutine(Loadscene()); + //View_Panel2Attatch.view_Panel2Attatch.StartCoroutine(View_Panel2Attatch.view_Panel2Attatch.Loadscene("AdamTraining_pilot_terminal_panl 1")); + } + else if(GlobalFlag.field_Char1 == "山地") + { + SceneManager.LoadScene("AdamTraining_pilot_terminal_panl 3"); + //View_Panel2Attatch.view_Panel2Attatch.StartCoroutine(View_Panel2Attatch.view_Panel2Attatch.Loadscene("AdamTraining_pilot_terminal_panl 3")); + } } + + public async void GetAllRoomData() { roomdata = await AsyncWebReq.Post(Url_RoomList, null); @@ -547,6 +559,7 @@ public class View_Panel2 : XUIPanel roomItem.transform.Find("view_btn").GetComponent