private void MouseControllerOnTileClicked(GameObject tileGameObject, int x, int y) { var tile = _mapView.GetTileByGameObject(tileGameObject); if (tile == null) { return; } if (_mouseController.CurrentMode == MouseController.MouseModes.Move && tile.CanMoveHere(x, y)) { if (_turnController.CurrentPlayer.Character.UpdateMovementTarget(x, y, tile)) { _turnController.CurrentPlayer.Character.UpdatePath(); return; } if (_turnController.CurrentPlayer.Character.MoveToTarget(x, y, tile)) { SetNoneMode(); } } if (_mouseController.CurrentMode == MouseController.MouseModes.DEBUG_PLACE_TILE && _adventureMap.IsValidPositionForNewTilePlacement(tile, x, y, out var placementDirection)) { if (!placementDirection.HasValue) { return; } var newTile = _tileStack.GetNexTile(); if (newTile != null) { _adventureMap.PlaceNewTileNearExistent(tile, newTile, placementDirection.Value); } } }