Exemple #1
0
        private void GameMap_UnitMoveCompleted(object sender, UnitMoveCompletedEventArgs e)
        {
            _movingComplete             = true;
            _moveUnitChangesContainer   = e.MoveUnitChangeContainer;
            _gameMap.UnitMoveCompleted -= GameMap_UnitMoveCompleted;

            _gameBattle.AddInputState(_inputStateFactory.ResolveUnitSelectActionState(_unit));
        }
Exemple #2
0
        public void UpdateState()
        {
            // Back button hit: Undo this state
            if (Input.GetMouseButtonDown(1))
            {
                _gameBattle.ClearTopInputState();
                return;
            }

            // Check if the player is selecting the unit they're moving. If so then the user doesn't want to move the unit so we'll advance to the UnitSelectAction state
            if (Input.GetMouseButtonDown(0))
            {
                var result = _gameMap.GetUnitAtCursor(out var unit);
                if (!result)
                {
                    return;
                }

                if (unit == _unit)
                {
                    _gameBattle.AddInputState(_inputStateFactory.ResolveUnitSelectActionState(_unit));
                }
            }
        }