From 7217b043903c4aa9c08f1ff47fa7b855e0cd5656 Mon Sep 17 00:00:00 2001 From: huyulong <1838407198@qq.com> Date: Thu, 12 Dec 2024 11:04:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=9B=B8=E5=85=B3=E7=9A=84?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=8A=A0=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaofang/Assets/Prefabs/HYLPrefabs/TaskItem.cs | 10 +++++++++- xiaofang/Assets/ProtoBuf/WEBScriptListener.cs | 2 +- xiaofang/Assets/ProtoBuf/test.cs | 11 +++++++---- xiaofang/Assets/Res/HYLUI/TaskPanel.cs | 5 +++-- xiaofang/Assets/Scenes/Tmap 1.unity | 2 +- .../Assets/Script/hylScripts/Free01/FreePanel01.cs | 2 +- xiaofang/Assets/UnityCommon | 2 +- 7 files changed, 23 insertions(+), 11 deletions(-) diff --git a/xiaofang/Assets/Prefabs/HYLPrefabs/TaskItem.cs b/xiaofang/Assets/Prefabs/HYLPrefabs/TaskItem.cs index 365ef2c0..6d888685 100644 --- a/xiaofang/Assets/Prefabs/HYLPrefabs/TaskItem.cs +++ b/xiaofang/Assets/Prefabs/HYLPrefabs/TaskItem.cs @@ -54,6 +54,7 @@ public class TaskItem : MonoBehaviour } + //初始化任务的属性 public void SetInfo(int id,JSONReader js) { taskId = id; @@ -62,15 +63,22 @@ public class TaskItem : MonoBehaviour UpdateTxt(); } + //更新Text void UpdateTxt() { Task_ info = jr.GetTaskByID(taskId); - Debug.Log(info); + //Debug.Log(info); tasktxt.text = info.Note; } + // 添加触发条件 + public void AddTrigger(int triggerType, string value) + { + triggers.Add(triggerType); + } + // Update is called once per frame void Update() { diff --git a/xiaofang/Assets/ProtoBuf/WEBScriptListener.cs b/xiaofang/Assets/ProtoBuf/WEBScriptListener.cs index 9f6811cb..d348ea2b 100644 --- a/xiaofang/Assets/ProtoBuf/WEBScriptListener.cs +++ b/xiaofang/Assets/ProtoBuf/WEBScriptListener.cs @@ -15,7 +15,7 @@ public class WEBScriptListener: MonoBehaviour //public string serverIP = "ws://192.168.3.110"; public string serverIP = "ws://222.212.4.120"; //服务器端口 - public int serverPort =12288; + public int serverPort = 2387; WebSocket socket; public string type; // 类型 public delegate void MyCallback(byte[] data); diff --git a/xiaofang/Assets/ProtoBuf/test.cs b/xiaofang/Assets/ProtoBuf/test.cs index d725ebb8..53605620 100644 --- a/xiaofang/Assets/ProtoBuf/test.cs +++ b/xiaofang/Assets/ProtoBuf/test.cs @@ -18,8 +18,8 @@ public class test : MonoBehaviour public string clientId = "e5cd7e4891bf95d1d19206ce24a7b32e"; public string grantType = "password"; public string userType = "company_user"; - public string username = "13699802230"; - public string password = "YYL2230!"; + public string username = "13006065371"; + public string password = "YYL5371!"; } //public async void loging() //{ @@ -32,6 +32,7 @@ public class test : MonoBehaviour // //Debug.Log(setverData.msg); //} + //登录 void lodingWebSocket() { @@ -51,6 +52,8 @@ public class test : MonoBehaviour wEBScriptListener.SendMessageByte(sendData); } + + //加入房间 void JoinRoom() { @@ -320,7 +323,7 @@ public class test : MonoBehaviour { lodingWebSocket(); //JoinRoom(); - //Heartbeat(); + Heartbeat(); //BroadcastMessage(); //UpFps(); //PickUpProp(); @@ -331,7 +334,7 @@ public class test : MonoBehaviour //TaskTrigger(); //TaskUpdateRequest(); } - int index = 0; + //int index = 0; //while (true) //{ // index++; diff --git a/xiaofang/Assets/Res/HYLUI/TaskPanel.cs b/xiaofang/Assets/Res/HYLUI/TaskPanel.cs index c667b7a0..c387c9ea 100644 --- a/xiaofang/Assets/Res/HYLUI/TaskPanel.cs +++ b/xiaofang/Assets/Res/HYLUI/TaskPanel.cs @@ -9,8 +9,6 @@ using System.Threading.Tasks; public class TaskPanel : Base { - private List tasks = new List(); - private Dictionary activeTasks = new Dictionary(); public static TaskPanel instance; @@ -48,7 +46,10 @@ public class TaskPanel : Base } + + + //将任务栏收起或显示 public void OnClickHideButton() { // 如果按钮已隐藏,点击后显示 diff --git a/xiaofang/Assets/Scenes/Tmap 1.unity b/xiaofang/Assets/Scenes/Tmap 1.unity index efc8e3ae..75aaa7b4 100644 --- a/xiaofang/Assets/Scenes/Tmap 1.unity +++ b/xiaofang/Assets/Scenes/Tmap 1.unity @@ -20289,7 +20289,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: serverIP: ws://222.212.4.120 - serverPort: 12288 + serverPort: 2387 type: --- !u!114 &1526740604 MonoBehaviour: diff --git a/xiaofang/Assets/Script/hylScripts/Free01/FreePanel01.cs b/xiaofang/Assets/Script/hylScripts/Free01/FreePanel01.cs index 9644908c..cfc4c3e5 100644 --- a/xiaofang/Assets/Script/hylScripts/Free01/FreePanel01.cs +++ b/xiaofang/Assets/Script/hylScripts/Free01/FreePanel01.cs @@ -24,7 +24,7 @@ public class FreePanel01 : MonoBehaviour { timeElapsed = 0f; - connectBtn.onClick.AddListener(OnClickConnectBtn); + //connectBtn.onClick.AddListener(OnClickConnectBtn);//监听点击打电话的按钮 } //当点击连接通话按钮 diff --git a/xiaofang/Assets/UnityCommon b/xiaofang/Assets/UnityCommon index 0385375c..2e42b278 160000 --- a/xiaofang/Assets/UnityCommon +++ b/xiaofang/Assets/UnityCommon @@ -1 +1 @@ -Subproject commit 0385375c1818fc57f42407a6c5301a26ded3a19a +Subproject commit 2e42b278d4c6ac9e045925dcc6e04896a19cbfd8