Beispiel #1
0
 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;
     }
 }
Beispiel #2
0
 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
             });
         }
     }
 }