Esempio n. 1
0
 public static void OnLogin(this UILoginComponent self)
 {
     LoginHelper.Login(
         self.DomainScene(),
         ConstValue.LoginAddress,
         self.account.GetComponent <InputField>().text,
         self.password.GetComponent <InputField>().text).Coroutine();
 }
Esempio n. 2
0
 public static void OnLogin(this UILoginView self)
 {
     self.loginBtn.SetInteractable(false);
     GlobalComponent.Instance.Account = self.account.GetText();
     PlayerPrefs.SetString(CacheKeys.Account, self.account.GetText());
     PlayerPrefs.SetString(CacheKeys.Password, self.password.GetText());
     LoginHelper.Login(self.scene, self.ipaddr.GetText(), self.account.GetText(), self.password.GetText(), () =>
     {
         self.loginBtn.SetInteractable(true);
     }).Coroutine();
 }
Esempio n. 3
0
        public static async ETTask <Scene> NewRobot(this RobotCase self, int zone, string name)
        {
            Scene zoneScene = null;

            try
            {
                zoneScene = SceneFactory.CreateZoneScene(zone, name, self);
                await LoginHelper.Login(zoneScene, ConstValue.LoginAddress, zone.ToString(), zone.ToString());

                await EnterMapHelper.EnterMapAsync(zoneScene);

                Log.Debug($"create robot ok: {zone}");
                return(zoneScene);
            }
            catch (Exception e)
            {
                zoneScene?.Dispose();
                throw new Exception($"RobotCase create robot fail, zone: {zone}", e);
            }
        }
Esempio n. 4
0
        private static async ETTask <Scene> NewRobot(this RobotCase self)
        {
            int   zone      = self.GetParent <RobotCaseComponent>().GetN();
            Scene zoneScene = null;

            try
            {
                zoneScene = SceneFactory.CreateZoneScene(zone, $"Robot_{zone}", self);
                await LoginHelper.Login(zoneScene, ConstValue.LoginAddress, zone.ToString(), zone.ToString());

                await EnterMapHelper.EnterMapAsync(zoneScene);

                Log.Debug($"create robot ok: {zone}");
                return(zoneScene);
            }
            catch (Exception e)
            {
                zoneScene?.Dispose();
                throw new Exception($"RobotCase create robot fail, zone: {zone}", e);
            }
        }
Esempio n. 5
0
 public static void OnLogin(this UILoginComponent self)
 {
     LoginHelper.Login(self.DomainScene(), "127.0.0.1:10002", self.account.GetComponent <InputField>().text).Coroutine();
 }