LoginHelper.cs 647 B

12345678910111213141516171819
  1. namespace ET.Client
  2. {
  3. public static class LoginHelper
  4. {
  5. public static async ETTask Login(Scene root, string address, string account, string password)
  6. {
  7. root.RemoveComponent<ClientSenderComponent>();
  8. ClientSenderComponent clientSenderComponent = root.AddComponent<ClientSenderComponent>();
  9. long playerId = await clientSenderComponent.LoginAsync(address, account, password);
  10. root.GetComponent<PlayerComponent>().MyId = playerId;
  11. await EventSystem.Instance.PublishAsync(root, new LoginFinish());
  12. }
  13. }
  14. }