This commit is contained in:
王志勋 2024-03-04 16:55:26 +08:00
parent 44f1046be0
commit 7ff4302abf
6 changed files with 62 additions and 13 deletions

View File

@ -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;
}
}
}

View File

@ -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<InputField>();
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<RoomData>(Url_RoomList, null);
@ -547,6 +559,7 @@ public class View_Panel2 : XUIPanel
roomItem.transform.Find("view_btn").GetComponent<Button>().onClick.AddListener(async () =>
{
Storm_and_capture_panl.gameObject.SetActive(true);
Debug.Log("查询房间科目:" + Url_QueryPracticeSubject + roomItem.name);
currentRoomData = await AsyncWebReq.Get<RSData.RoomSubjectData>(Url_QueryPracticeSubject + roomItem.name);
currentRoomName = roomItem.name;
GlobalFlag.roomID = roomItem.name;

View File

@ -1,4 +1,4 @@
using AdamThinkDevicesData;
using AdamThinkDevicesData;
using PData;
using RDate;
using System.Collections;
@ -48,6 +48,7 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
string _url = sceneInfoUrl + roomId;
//Debug.LogError(_url);
currentSceneInfo = await AsyncWebReq.Get<SceneRoot>(_url);
GlobalFlag.field_Char1 = currentSceneInfo.data.Field_Char1;
}
public void GetSubjectInfo(List<RSData.SubjectDataItem> sdi)

View File

@ -1,4 +1,4 @@
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
@ -9,6 +9,7 @@ public class GlobalFlag
public static UserInfo currentUser;
public static string roomID;
public static string practiceId;
/// <summary>
/// 席位ID
/// </summary>
@ -32,7 +33,7 @@ public class GlobalFlag
/// <summary>
/// 当前想定的地图
/// </summary>
public static string landform;
public static string field_Char1;
public static bool CheckGuiRaycastObjects(EventSystem eventSystem, GraphicRaycaster graphicRaycaster)
{
PointerEventData eventData = new PointerEventData(eventSystem);

View File

@ -8,9 +8,16 @@ using System;
/// </summary>
public class SaveVideoToPersistentData : MonoBehaviour
{
public static SaveVideoToPersistentData saveVideoToPersistent;
public CaptureBase _movieCapture = null;
public bool isPlayer = false;
private void Start()
{
saveVideoToPersistent = this;
}
public void StartCapture()
{
if (_movieCapture != null)
@ -30,8 +37,6 @@ public class SaveVideoToPersistentData : MonoBehaviour
_movieCapture.StopCapture();
}
}
private void OnDestroy()
{
StopCapture();
}
}

View File

@ -116,6 +116,7 @@ public class NetMqListener
public void UnSubtopic(string topic)
{
Debug.Log("退出订阅" + topic);
SaveVideoToPersistentData.saveVideoToPersistent.StopCapture();
subSocket.Unsubscribe(topic);
}
public void AddToMono(st_Motions st)