提交进入地图和创建房间相关逻辑和协议

This commit is contained in:
2025-08-27 18:05:55 +08:00
parent f6d85a1e0a
commit 94af0e5ddb
31 changed files with 562 additions and 68 deletions

View File

@@ -0,0 +1,38 @@
using Fantasy;
using Fantasy.Async;
using Fantasy.Entitas.Interface;
using Unity.Mathematics;
namespace NB.Map;
public class MapUnitSystemDestroySystem : DestroySystem<MapUnit>
{
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<uint> EnterMap(this MapUnit self, int mapId)
{
var mapManageComponent = self.Scene.GetComponent<MapManageComponent>();
var map = mapManageComponent.Get(mapId);
if (map == null)
{
return ErrorCode.MapIdError;
}
// map.en
await FTask.CompletedTask;
return ErrorCode.Successful;
}
}