提交示例代码
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Entitas.Interface;
|
||||
// ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
|
||||
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
|
||||
|
||||
namespace Fantasy;
|
||||
|
||||
public sealed class GateAccountFlagComponentSystem : DestroySystem<GateAccountFlagComponent>
|
||||
{
|
||||
protected override void Destroy(GateAccountFlagComponent self)
|
||||
{
|
||||
// DestroyAsync(self).Coroutine();
|
||||
|
||||
var selfAccount = self.Account;
|
||||
if (selfAccount == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var selfAccountMailRouteId = selfAccount.MailRouteId;
|
||||
GateLoginHelper.Offline(self.Scene, selfAccountMailRouteId).Coroutine();
|
||||
self.Account = null;
|
||||
selfAccount.Dispose();
|
||||
}
|
||||
|
||||
// private async FTask DestroyAsync(GateAccountFlagComponent self)
|
||||
// {
|
||||
// var selfAccount = self.Account;
|
||||
// if (selfAccount == null)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
// await GateLoginHelper.Offline(self.Scene,selfAccount.MailRouteId)
|
||||
// self.Account = null;
|
||||
// selfAccount.Dispose();
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user