From 4eee267da3ef31badeddb2df8736cfa6cc0d4f65 Mon Sep 17 00:00:00 2001 From: "DESKTOP-B25GA9E\\W35" <1733709035@qq.com> Date: Tue, 7 Mar 2023 17:55:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0UDP=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=A1=88=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Example/Scenes/UDPLinkExample.unity | 53 +++++++++++++++++++ .../Example/Script/UDPExample.cs | 26 +++++++++ .../Example/Script/UDPExample.cs.meta | 11 ++++ 3 files changed, 90 insertions(+) create mode 100644 Assets/MsgTransmitTools/Example/Script/UDPExample.cs create mode 100644 Assets/MsgTransmitTools/Example/Script/UDPExample.cs.meta diff --git a/Assets/MsgTransmitTools/Example/Scenes/UDPLinkExample.unity b/Assets/MsgTransmitTools/Example/Scenes/UDPLinkExample.unity index f1df6b8..3eb3d30 100644 --- a/Assets/MsgTransmitTools/Example/Scenes/UDPLinkExample.unity +++ b/Assets/MsgTransmitTools/Example/Scenes/UDPLinkExample.unity @@ -130,6 +130,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 495072130} + - component: {fileID: 495072131} m_Layer: 0 m_Name: ScriptManage m_TagString: Untagged @@ -151,6 +152,18 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &495072131 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 495072129} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c4d0e1e2ff99ce341a7954c75d38f96a, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1048467951 GameObject: m_ObjectHideFlags: 0 @@ -618,6 +631,36 @@ PrefabInstance: propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 1657411067251951680, guid: 024f7da41de8c5a48a15953f6782dd47, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1657411067251951680, guid: 024f7da41de8c5a48a15953f6782dd47, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1657411067251951680, guid: 024f7da41de8c5a48a15953f6782dd47, + type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1657411067251951680, guid: 024f7da41de8c5a48a15953f6782dd47, + type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1657411067920407139, guid: 024f7da41de8c5a48a15953f6782dd47, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1657411067920407139, guid: 024f7da41de8c5a48a15953f6782dd47, + type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 1657411067946607568, guid: 024f7da41de8c5a48a15953f6782dd47, type: 3} propertyPath: m_AnchorMax.x @@ -628,6 +671,16 @@ PrefabInstance: propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 1657411068659631618, guid: 024f7da41de8c5a48a15953f6782dd47, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1657411068659631618, guid: 024f7da41de8c5a48a15953f6782dd47, + type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 024f7da41de8c5a48a15953f6782dd47, type: 3} --- !u!224 &4149678946757492273 stripped diff --git a/Assets/MsgTransmitTools/Example/Script/UDPExample.cs b/Assets/MsgTransmitTools/Example/Script/UDPExample.cs new file mode 100644 index 0000000..f546bed --- /dev/null +++ b/Assets/MsgTransmitTools/Example/Script/UDPExample.cs @@ -0,0 +1,26 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using JXSoft; + +public class UDPExample : MonoBehaviour,IUDPClient +{ + // Start is called before the first frame update + void Start() + { + this.RegisterMessageEvent(e => + { + Debug.Log(e.msg); + }); + this.onReceive(); + } + + // Update is called once per frame + void Update() + { + + } +} +public class UResponseTest:AbstractJsonResponse { + public string msg; +} diff --git a/Assets/MsgTransmitTools/Example/Script/UDPExample.cs.meta b/Assets/MsgTransmitTools/Example/Script/UDPExample.cs.meta new file mode 100644 index 0000000..d70fba8 --- /dev/null +++ b/Assets/MsgTransmitTools/Example/Script/UDPExample.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c4d0e1e2ff99ce341a7954c75d38f96a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: