Beispiel #1
0
        public override void Execute(ICommandContext context)
        {
            base.Execute(context);
            GameInContext gameInContext = context as GameInContext;

            m_nSceneId = gameInContext.sceneId;
            var resScene = ResCfgSys.Instance.GetCfg <ResScene>(m_nSceneId);

            m_cAsyncOperation = SceneManager.LoadSceneAsync(resScene.name);
        }
Beispiel #2
0
        protected override void OnEnter()
        {
            BattleInfo.Clear();
            BattleInfo.userId = 1;
            GameObjectPool.Instance.Clear();
            ViewSys.Instance.Open("LoadingView");
            m_cJoinSequence = new CommandSequence();
            var cmdConnectBattleServer = new Cmd_ConnectBattleServer();
            var cmdLoadScene           = new Cmd_LoadScene();

            cmdLoadScene.On_Done += OnLoadSceneDone;
            m_cJoinSequence.AddSubCommand(cmdConnectBattleServer);
            m_cJoinSequence.AddSubCommand(cmdLoadScene);
            m_cJoinSequence.On_Done += OnJoinScene;
            GameInContext context = new GameInContext();

            context.sceneId = GameConst.Instance.GetInt("default_scene_id");
            m_cJoinSequence.Execute(context);
        }