mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] 接入ET8服务端
[+] 接入ET8服务端
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
|
||||
|
||||
namespace ET.Client
|
||||
{
|
||||
public static partial class EnterMapHelper
|
||||
{
|
||||
public static async ETTask EnterMapAsync(Scene root)
|
||||
{
|
||||
try
|
||||
{
|
||||
G2C_EnterMap g2CEnterMap = await root.GetComponent<ClientSenderCompnent>().Call(new C2G_EnterMap()) as G2C_EnterMap;
|
||||
|
||||
// 等待场景切换完成
|
||||
await root.GetComponent<ObjectWait>().Wait<Wait_SceneChangeFinish>();
|
||||
|
||||
EventSystem.Instance.Publish(root, new EventType.EnterMapFinish());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static async ETTask Match(Fiber fiber)
|
||||
{
|
||||
try
|
||||
{
|
||||
G2C_Match g2CEnterMap = await fiber.Root.GetComponent<ClientSenderCompnent>().Call(new C2G_Match()) as G2C_Match;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user