Hi,
Can someone please explain me where the Vector2Int gridPos; from the Waypoint.cs is being used ??
It looks like an unused variable to me ???
public class Waypoint : MonoBehaviour {
Vector2Int gridPos;
const int gridSize = 10;
public int GetGridSize()
{
return gridSize;
}
public Vector2Int GetGridPos()
{
return new Vector2Int(
Mathf.RoundToInt(transform.position.x / gridSize),
Mathf.RoundToInt(transform.position.z / gridSize)
);
}
public void SetTopColor(Color color)
{
MeshRenderer topMeshRenderer = transform.Find("Top").GetComponent<MeshRenderer>();
topMeshRenderer.material.color = color;
}
}