Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void GetReachableTiles()
- {
- for(int i = 0; i < gridArray.GetLength(0); i++)
- {
- for (int j = 0; j < gridArray.GetLength(1); j++)
- {
- Vector2 gridPos = new Vector2(gridArray[i, j].GetComponent<GridStats>().x, gridArray[i, j].GetComponent<GridStats>().y);
- if(Vector2.Distance(gridPos, new Vector2(startX, startY)) <= playerRange)
- {
- gridArray[i, j].GetComponent<Renderer>().material.color = Color.blue;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement