public void HandlePlayerRadiousVisualiation(GridObject currentActiveCell, GridObject playerCell) { if (!player.CellInRadious(currentActiveCell) && !mouseOutofRadious) { VisualizeRadious(playerCell); mouseOutofRadious = true; } else if (player.CellInRadious(currentActiveCell) && mouseOutofRadious) { ClearVisalizeRadious(); mouseOutofRadious = false; } }
void HandlePathFindingAndVisualiation(GridObject currentActiveCell, GridObject playerCell) { if (lastActiveCell != currentActiveCell || lastPlayerCell != playerCell) { lastActiveCell = currentActiveCell; lastPlayerCell = playerCell; if (player.CellInRadious(currentActiveCell)) { playerPath = grid.FindPath(playerCell, currentActiveCell); OnPlayerPathChanged?.Invoke(this, new OnPathChangedArgs { newPath = playerPath }); } } }