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
 public override void DeSerialize(MemoryStream stream)
 {
     data = SCStartGame.Parser.ParseFrom(stream);
 }