From 734d3c7cfcbe11c327fd8d74f8b0bd5597d2c2fb Mon Sep 17 00:00:00 2001 From: YangHua <1475658476@qq.com> Date: Wed, 22 Nov 2023 15:03:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=BB=E7=BA=BF=E5=92=8C=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Temp/Scripts/Taskpanel.cs | 34 ++++++-- Assets/Temp/Scripts/View_Panel2.cs | 2 +- .../AdamTraining_pilot_terminal_panl 1.unity | 42 +++++++-- .../Scripts/Adam/Data/ThinkDevicesData.cs | 2 +- Assets/Zion/Scripts/Adam/GameManager.cs | 87 +++++++++++++++---- Assets/Zion/Scripts/Adam/UIBootstrap.cs | 13 ++- .../Adam/Utility/Sync/SyncPlayerTransform.cs | 12 +-- .../ModelFunction/SingleMachineTest.cs | 4 +- 8 files changed, 155 insertions(+), 41 deletions(-) diff --git a/Assets/Temp/Scripts/Taskpanel.cs b/Assets/Temp/Scripts/Taskpanel.cs index e4cd78e3..8e4f4615 100644 --- a/Assets/Temp/Scripts/Taskpanel.cs +++ b/Assets/Temp/Scripts/Taskpanel.cs @@ -1,4 +1,5 @@ -using System.Collections; +using AdamSync; +using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; @@ -18,7 +19,7 @@ public class Taskpanel : MonoBehaviour /// /// 二维地图页面 /// - + public RectTransform measure_panl;//测量页面 public RectTransform punctuation_panl;//标记工具 public RectTransform specific_panl;//专用标会 @@ -38,19 +39,24 @@ public class Taskpanel : MonoBehaviour public Button fanhuiBtn; public Button fanhui; - private bool isp=true; + private bool isp = true; void Start() { + + AdamSync.SyncCreateRoom.leaveRoomRequset += OnGetLeaveRoomsInfo; + fanhui.onClick.AddListener(() => { GameMain.tiao = false; - SceneManager.LoadScene("SampleScene"); + OnLeaveRoom(); + + }); two_dimensional.onClick.AddListener(() => { //two_dimensional.gameObject.SetActive(false); //playback_btn.gameObject.SetActive(false); - model.gameObject.SetActive(true); + model.gameObject.SetActive(true); }); ////返回按钮 //fanhuiBtn.onClick.AddListener(() => @@ -119,7 +125,7 @@ public class Taskpanel : MonoBehaviour }); menu_button.onClick.AddListener(() => { - if (isp==true) + if (isp == true) { measure_btn.gameObject.SetActive(false); punctuation_btn.gameObject.SetActive(false); @@ -139,10 +145,22 @@ public class Taskpanel : MonoBehaviour } }); } - + public void OnGetLeaveRoomsInfo(string msg) + { + Debug.Log("OnGetLeaveRoomsInfo====" + msg); + string[] info = msg.Split(','); + GameManager.Instance.RemovePlayer(ulong.Parse(info[0])); + SceneManager.LoadScene("SampleScene"); + } + public void OnLeaveRoom() + { + Debug.Log("Leaveroom"); + string msg = "leaveroom "; + _ = SyncCreateRoom.SendMessageAsync(msg); + } // Update is called once per frame void Update() { - + } } diff --git a/Assets/Temp/Scripts/View_Panel2.cs b/Assets/Temp/Scripts/View_Panel2.cs index 4872104e..3d62303a 100644 --- a/Assets/Temp/Scripts/View_Panel2.cs +++ b/Assets/Temp/Scripts/View_Panel2.cs @@ -574,12 +574,12 @@ public class View_Panel2 : XUIPanel GameObject subjectTemp = GameObject.Instantiate(currentRoomSubjectItem, currentRoomSubjectItemConnect); subjectTemp.SetActive(true); subjectTemp.name = di[index].Id; - GlobalFlag.practiceSubjectID = subjectTemp.name; subjectTemp.transform.GetChild(0).GetComponent().text = di[index].Name; subjectTemp.GetComponent