地图相关协议

This commit is contained in:
2025-08-25 23:56:28 +08:00
parent a3768e4aa2
commit 110daec6ea
13 changed files with 111 additions and 33 deletions

View File

@@ -15,7 +15,7 @@ namespace NBF
_session = Net.CreateSession("127.0.0.1:20001");
_session.Scene.AddComponent<UnitUnityComponent>();
var acc = account;
// 发送登录的请求给服务器
@@ -52,6 +52,7 @@ namespace NBF
}
Log.Debug($"登录到Gate服务器成功ErrorCode:{loginResponse.ErrorCode}");
await _session.Scene.EventComponent.PublishAsync(new ChangePosition());
}
}
}

View File

@@ -20,13 +20,14 @@ namespace NBF
{
if (btn == BtnLogin)
{
var unitGameObject = new GameObject("Unit");
var unit = Entity.Create<Unit>(App.Main, true, true);
var unitUnity = unit.AddComponent<UnitUnityComponent>();
unitUnity.SetGameObject(unitGameObject);
// App.Main.add
// LoginHelper.Login(InputAccount.text).Coroutine();
OnLoginClick().Coroutine();
}
}
private async FTask OnLoginClick()
{
await LoginHelper.Login(InputAccount.text);
await MapHelper.Enter(99);
}
}
}