修改为luban

This commit is contained in:
Bob.Song
2026-03-05 15:03:45 +08:00
parent 13e4315a70
commit 36067705f2
122 changed files with 10497 additions and 2216 deletions

View File

@@ -0,0 +1,22 @@
using Fantasy.Entitas.Interface;
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
namespace NB.Chat;
public sealed class SocialUnitDestroySystem : DestroySystem<SocialUnit>
{
protected override void Destroy(SocialUnit self)
{
self.Role.Return();
self.Role = null;
self.GateRouteId = 0;
// 退出当前ChatUnit拥有的所有频道
foreach (var (_,chatChannelComponent) in self.Channels)
{
chatChannelComponent.ExitChannel(self.Id, false);
}
// 理论情况下这个self.Channels不会存在因为数据的因为上面已经给清空掉了。
// 但是self.Channels.Clear();还是加上吧,防止以后忘记了。
self.Channels.Clear();
}
}