From a885a394c0367c2feb072d96b0e2656dadeac07e Mon Sep 17 00:00:00 2001 From: xiaohang Date: Fri, 26 Apr 2024 11:03:04 +0800 Subject: [PATCH] =?UTF-8?q?namespace=E5=90=8D=E7=A7=B0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9BLoom=E7=B1=BB=E5=90=8D=E4=BF=AE=E6=94=B9=E9=98=B2?= =?UTF-8?q?=E6=AD=A2=E5=92=8C=E5=85=B6=E4=BB=96=E5=B7=A5=E7=A8=8B=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/GameEventMgr.cs | 2 +- Runtime/GameKcpClient.cs | 6 +++--- Runtime/{Loom.cs => LoomUtil.cs} | 10 +++++----- Runtime/{Loom.cs.meta => LoomUtil.cs.meta} | 0 Runtime/ProtobufHelper.cs | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) rename Runtime/{Loom.cs => LoomUtil.cs} (96%) rename Runtime/{Loom.cs.meta => LoomUtil.cs.meta} (100%) diff --git a/Runtime/GameEventMgr.cs b/Runtime/GameEventMgr.cs index ea558a0..e4a45fc 100644 --- a/Runtime/GameEventMgr.cs +++ b/Runtime/GameEventMgr.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using UnityEngine; -namespace Guru +namespace DofLibrary { public class GameEventMgr diff --git a/Runtime/GameKcpClient.cs b/Runtime/GameKcpClient.cs index ee00a3f..97daccd 100644 --- a/Runtime/GameKcpClient.cs +++ b/Runtime/GameKcpClient.cs @@ -116,7 +116,7 @@ namespace DofLibrary if (OnConnected != null) { - Loom.QueueOnMainThread(() => + LoomUtil.QueueOnMainThread(() => { OnConnected.Invoke(); }); @@ -139,7 +139,7 @@ namespace DofLibrary if (msg is ServerMessage server_msg) { - Loom.QueueOnMainThread(() => + LoomUtil.QueueOnMainThread(() => { ProcessMessage(server_msg); }); @@ -169,7 +169,7 @@ namespace DofLibrary Debug.Log("[GameKcpClient]: Connection closed"); if (OnDisConnected != null) { - Loom.QueueOnMainThread(() => + LoomUtil.QueueOnMainThread(() => { OnDisConnected.Invoke(); }); diff --git a/Runtime/Loom.cs b/Runtime/LoomUtil.cs similarity index 96% rename from Runtime/Loom.cs rename to Runtime/LoomUtil.cs index c06abe2..84aa5be 100644 --- a/Runtime/Loom.cs +++ b/Runtime/LoomUtil.cs @@ -3,17 +3,17 @@ using System.Collections.Generic; using System.Threading; using UnityEngine; -namespace Guru +namespace DofLibrary { // Loom lets you easily run code on another thread and have that other thread run code on the main game thread when it needs to. - public class Loom : MonoBehaviour + public class LoomUtil : MonoBehaviour { public static int maxThreads = 10; private static int numThreads; - private static Loom _instance; + private static LoomUtil _instance; - public static Loom Instance + public static LoomUtil Instance { get { @@ -39,7 +39,7 @@ namespace Guru initialized = true; var g = new GameObject("Loom"); DontDestroyOnLoad(g); - _instance = g.AddComponent(); + _instance = g.AddComponent(); } } diff --git a/Runtime/Loom.cs.meta b/Runtime/LoomUtil.cs.meta similarity index 100% rename from Runtime/Loom.cs.meta rename to Runtime/LoomUtil.cs.meta diff --git a/Runtime/ProtobufHelper.cs b/Runtime/ProtobufHelper.cs index 62a8f40..2557ae8 100644 --- a/Runtime/ProtobufHelper.cs +++ b/Runtime/ProtobufHelper.cs @@ -2,7 +2,7 @@ using System.IO; using ProtoBuf.Meta; -namespace Guru +namespace DofLibrary { public interface ISupportInitialize {