void ShowPath(int speed) { if (currenPathExists) { HexCell_Script current = currentPathTo; while (current != currentPathFrom) { int turn = (current.Distance - 1) / speed; current.SetLabel(turn.ToString()); current.EnableHighlight(Color.white); current = current.PathFrom; } } currentPathFrom.EnableHighlight(Color.blue); currentPathTo.EnableHighlight(Color.red); }
public void ClearPath() { if (currenPathExists) { HexCell_Script current = currentPathTo; while (current != currentPathFrom) { current.SetLabel(null); current.DisableHighlight(); current = current.PathFrom; } current.DisableHighlight(); currenPathExists = false; } currentPathFrom = null; currentPathTo = null; }