zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Unity/Assets/Hotfix/Session/SessionComponentSystem.cs

32 lines
833 B
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00
using ET;
namespace ET
{
public class SessionComponentAwakeSystem : AwakeSystem<SessionComponent>
{
public override void Awake(SessionComponent self)
{
2021-04-08 20:09:59 +08:00
}
}
public class SessionComponentDestroySystem : DestroySystem<SessionComponent>
{
public override void Destroy(SessionComponent self)
{
self.Session.Dispose();
}
}
public static class SessionComponentSystem
{
public static async ETTask<T> Call<T>(this SessionComponent self, IRequest request, bool isMask = true) where T : IResponse
{
if (isMask)
NetLoadingHelper.Play();
2021-04-11 19:50:39 +08:00
T ret = (T)await self.Session.Call(request);
2021-04-08 20:09:59 +08:00
if (isMask)
NetLoadingHelper.Stop();
return ret;
}
}
}