tanghai 1 рік тому
батько
коміт
40121c3ca4

+ 1 - 1
Unity/Assets/Scripts/Hotfix/Client/Demo/Main/ClientSenderComponentSystem.cs

@@ -30,7 +30,7 @@ namespace ET.Client
             await FiberManager.Instance.Remove(fiberId);
         }
 
-        public static async ETTask DisposeClientSender(this ClientSenderComponent self)
+        public static async ETTask DisposeAsync(this ClientSenderComponent self)
         {
             await self.RemoveFiberAsync();
             self.Dispose();

+ 5 - 2
Unity/Assets/Scripts/Hotfix/Client/Demo/NetClient/LoginHelper.cs

@@ -4,9 +4,12 @@ namespace ET.Client
     {
         public static async ETTask Login(Scene root, string account, string password)
         {
-            var clientSenderComponent = root.GetComponent<ClientSenderComponent>();
+            ClientSenderComponent clientSenderComponent = root.GetComponent<ClientSenderComponent>();
             if (clientSenderComponent != null)
-                await clientSenderComponent.DisposeClientSender();
+            {
+                await clientSenderComponent.DisposeAsync();
+            }
+            
             clientSenderComponent = root.AddComponent<ClientSenderComponent>();
             
             long playerId = await clientSenderComponent.LoginAsync(account, password);