using Fantasy; using Fantasy.Async; using Fantasy.Entitas.Interface; using Unity.Mathematics; namespace NB.Map; public class MapUnitSystemDestroySystem : DestroySystem { protected override void Destroy(MapUnit self) { self.MapId = 0; self.Position = float3.zero; self.Rotation = float4.zero; self.GateRouteId = 0L; } } public static class MapUnitSystem { public static async FTask EnterMap(this MapUnit self, int mapId) { var mapManageComponent = self.Scene.GetComponent(); var map = mapManageComponent.Get(mapId); if (map == null) { return ErrorCode.MapIdError; } // map.en await FTask.CompletedTask; return ErrorCode.Successful; } }