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

32 lines
833 B
C#

using ET;
namespace ET
{
public class SessionComponentAwakeSystem : AwakeSystem<SessionComponent>
{
public override void Awake(SessionComponent self)
{
}
}
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();
T ret = (T)await self.Session.Call(request);
if (isMask)
NetLoadingHelper.Stop();
return ret;
}
}
}