Example #1
0
        public void StartBattle(SCStartGame res)
        {
            BeforeStartGame(SyncMode.STEP_LOCK);
            CharacterBase mainPlayer    = GameClient.Instance.MainPlayer;
            CharacterBase currentPlayer = null;

            foreach (var p in res.Uins)
            {
                if (p == _uin)
                {
                    currentPlayer = mainPlayer;
                }
                else
                {
                    currentPlayer = CharacterManager.Instance.GetNewCharacter();
                }
                currentPlayer.ThisData.uin = p;
                currentPlayer.ChangeCharacter(1);
                currentPlayer.Init();
                _inputListeners.Add(currentPlayer.ThisData.uin, currentPlayer);
                currentPlayer.Position = Vector3.zero;
                TickerManager.Instance.AddTick(currentPlayer);
                TickerManager.Instance.AddFixedTick(currentPlayer);
            }
            AfterStartGame();
        }
Example #2
0
        private void RealStart()
        {
            BattleUIManager.Instance.Init();

            _mainPlayer = CharacterManager.Instance.GetNewCharacter();
            _inputHandle.AddInputListener(_mainPlayer);
            _mainPlayer.ChangeCharacter(1);
            Test();
            //帧同步模式
            //ClientNetManager.Instance.Connect("127.0.0.1", 5678);
        }
Example #3
0
        //非帧同步模式
        public void Test()
        {
            GameSyncManager.Instance.BeforeStartGame(SyncMode.NORMAL);
            _mainPlayer.ThisData.uin = 1;
            _mainPlayer.Position     = new Vector3(5f, 0f, 5f);
            CharacterBase testEnemy = CharacterManager.Instance.GetNewCharacter();

            testEnemy.ChangeCharacter(1);
            testEnemy.Position     = Vector3.zero;
            testEnemy.ThisData.uin = 2;
            _inputHandle.AddInputListener(_mainPlayer);
            TickerManager.Instance.AddTick(_mainPlayer);
            TickerManager.Instance.AddFixedTick(_mainPlayer);
            TickerManager.Instance.AddTick(testEnemy);
            TickerManager.Instance.AddFixedTick(testEnemy);
            GameSyncManager.Instance.AfterStartGame();
        }