Пример #1
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);
            }
        }
Пример #2
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);
            }
        }
Пример #3
0
        public static async ETTask EnterMap(this UILobbyComponent self)
        {
            await EnterMapHelper.EnterMapAsync(self.ZoneScene());

            await UIHelper.Remove(self.ZoneScene(), UIType.UILobby);
        }
Пример #4
0
 public static void EnterMap(this UILobbyComponent self)
 {
     EnterMapHelper.EnterMapAsync(self.ZoneScene()).Coroutine();
 }
Пример #5
0
 public static void OnEnterBtnClick(this UILobbyView self)
 {
     EnterMapHelper.EnterMapAsync(self.zoneScene).Coroutine();
 }