Example #1
0
    public void Update()
    {
        var tile = _map.GetTileByMouse();

        if (Game.I.MapController.IsWalkable(tile))
        {
            if (_lastPoint == null || _lastPoint.X != tile.x || _lastPoint.Y != tile.y)
            {
                _lastPoint = new Point(tile.x, tile.y);
                var start      = _map.GetTileByVector3(_pos);
                var startPoint = new Point(start.x, start.y);
                var path       = _map.PathFinder.FindPath(startPoint, _lastPoint, false);
                if (path.Count > _moveLimit)
                {
                    path.RemoveRange(_moveLimit, path.Count - _moveLimit);
                }
                _path = path;
                _prediction.DrawMoveInput(path);
            }
        }
        else
        {
            _lastPoint = null;
            _path      = null;
            _prediction.ClearLayer(Layers.Temporary);
        }
    }
Example #2
0
 public void CloseConfirm()
 {
     Game.I.UserInputController.ReleaseCharacter();
     PredictionMap.ClearLayer(Layers.Temporary);
     Game.I.MapController.OutlinePool.ReturnAll();
     ConfirmPanel.SetActive(false);
     ShootConfirmPanel.Hide();
     _selectedInput = null;
     HideActionPanel();
     _isWaitForConfirm = false;
 }
    public void Update()
    {
        var tile       = Game.I.MapController.GetTileByMouse();
        var mousePoint = new Point(tile.x, tile.y);

        foreach (var range in _grenade.GetAvailableRange(_position))
        {
            if (range.Any(r => r.Equals(mousePoint)))
            {
                _target = mousePoint;
                DrawExplosionRange(mousePoint);
                break;
            }
            _target = null;
            _prediction.ClearLayer(Layers.Temporary);
        }
    }
Example #4
0
    public void Update()
    {
        var map        = Game.I.MapController;
        var tile       = map.GetTileByMouse();
        var mousePoint = new Point(tile.x, tile.y);

        foreach (var range in _weapon.GetAvailableRange(_position))
        {
            if (range.Any(r => r.Equals(mousePoint)))
            {
                _range = range;
                _prediction.DrawShootInput(range);
                break;
            }
            _range = null;
            _prediction.ClearLayer(Layers.Temporary);
        }
    }