From a5029ff06fb98c4cf987730185e4f45aec36f271 Mon Sep 17 00:00:00 2001 From: yulong <1838206582@qq.com> Date: Mon, 2 Dec 2024 18:05:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scenes/TobaccoModelTest.unity | 24 ++++++++++++++-- Assets/Scripts/YL/Interaction.cs | 41 +++++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 3 deletions(-) diff --git a/Assets/Scenes/TobaccoModelTest.unity b/Assets/Scenes/TobaccoModelTest.unity index f3991c5..960d5b5 100644 --- a/Assets/Scenes/TobaccoModelTest.unity +++ b/Assets/Scenes/TobaccoModelTest.unity @@ -37989,6 +37989,11 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_IsOn: 1 +--- !u!1 &659197992 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 2245508502134690820, guid: 39a335e786bde4a4cb631c0df951e857, type: 3} + m_PrefabInstance: {fileID: 3512625707777796314} + m_PrefabAsset: {fileID: 0} --- !u!1 &659521673 stripped GameObject: m_CorrespondingSourceObject: {fileID: 9159787642519714698, guid: 266ce14b00e8a694eae7fcaa9f961a0a, type: 3} @@ -46351,6 +46356,16 @@ MonoBehaviour: boxbtn: {fileID: 1782092396} status: 0 doubleClickTime: 0.3 + Pages: + - {fileID: 1506387291} + - {fileID: 659197992} + - {fileID: 1155727719} + - {fileID: 1834165759} + - {fileID: 1654914791} + - {fileID: 963009407} + - {fileID: 640309424} + - {fileID: 667812693} + - {fileID: 617481940} --- !u!1 &798230193 GameObject: m_ObjectHideFlags: 0 @@ -86235,6 +86250,11 @@ MonoBehaviour: Boxgame: {fileID: 8783056752875549894, guid: 3c858a60db3529f4698ac98e5b04d78b, type: 3} Boxgame2: {fileID: 1918721954697570452, guid: 3c5c67ef5f8f1da40b4a0efd25da6d96, type: 3} Points: {fileID: 1505959618} +--- !u!1 &1506387291 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 7606412406424721026, guid: f236267bb0216b741aedaac2814f3c7d, type: 3} + m_PrefabInstance: {fileID: 2742845333394743471} + m_PrefabAsset: {fileID: 0} --- !u!1 &1507629455 GameObject: m_ObjectHideFlags: 0 @@ -139463,7 +139483,7 @@ MonoBehaviour: m_CorrespondingSourceObject: {fileID: 66984057074791586, guid: f236267bb0216b741aedaac2814f3c7d, type: 3} m_PrefabInstance: {fileID: 2742845333394743471} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} + m_GameObject: {fileID: 1506387291} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 66038161a747c7a4d8c2de715cb3b2ba, type: 3} @@ -144730,7 +144750,7 @@ MonoBehaviour: m_CorrespondingSourceObject: {fileID: 2977119899721617728, guid: 39a335e786bde4a4cb631c0df951e857, type: 3} m_PrefabInstance: {fileID: 3512625707777796314} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} + m_GameObject: {fileID: 659197992} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: b5152f41230d16c4186a29c60b22563c, type: 3} diff --git a/Assets/Scripts/YL/Interaction.cs b/Assets/Scripts/YL/Interaction.cs index 66d1748..f40b007 100644 --- a/Assets/Scripts/YL/Interaction.cs +++ b/Assets/Scripts/YL/Interaction.cs @@ -1,6 +1,7 @@ using cakeslice; using DefaultNamespace; using System; +using System.Collections.Generic; using Unity.VisualScripting; using UnityEngine; using UnityEngine.UI; @@ -62,6 +63,7 @@ public class Interaction : MonoBehaviour /// private float lastClickTime = 0f; public float doubleClickTime = 0.3f; + public List Pages = new List(); void Start() { boxbtn.onClick.AddListener(Tests); @@ -371,6 +373,7 @@ public class Interaction : MonoBehaviour lastClickTime = Time.time; } } + /// /// 移除提示亮光 /// @@ -381,5 +384,41 @@ public class Interaction : MonoBehaviour OutlineEffect.Instance.outlines.Clear(); } } - + /// + /// + /// + /// + public void Popupwindow(string value) + { + int index = int.Parse(value); + if (index > 0 && index < 9) + { + if (Pages.Count > 0) + { + for (int i = 0; i < Pages.Count; i++) + { + if (Pages[i].gameObject) + { + Pages[i].SetActive(false); + } + } + Removeprompt(); + } + string url = Carinterface + index; + StartCoroutine(Post1(url, (data) => + { + // Debug.Log(data); + Debug.Log("小车返回数据" + data); + Cardata cardata = JsonUtility.FromJson(data); + string pos = cardata.result.carRow + "行-" + cardata.result.carColumn + "列-" + cardata.result.carLayer + "层"; + UIDeviceBaseInfoPanel.Getdata(cardata.result.id, cardata.result.carMode, pos, cardata.result.carPlt, cardata.result.isOnline, cardata.result.boxCode, cardata.result.batCurrent, cardata.result.jobID, + cardata.result.error1, cardata.result.batVoltage, cardata.result.carAngle, cardata.result.batTemperature, () => + { + Removeprompt(); + UIDeviceBaseInfoPanel.gameObject.SetActive(false); + }); + UIDeviceBaseInfoPanel.gameObject.SetActive(true); + })); + } + } }