public void Update() { if (Input.GetMouseButtonDown(0)) { Vector2 worldPosition = GridBuilderUtils.ScreenToWorld(root, Input.mousePosition); DiamondPoint rectPoint = map[worldPosition]; if (grid.Contains(rectPoint)) { grid[rectPoint].OnClick(); } } }
public void Update() { if (Input.GetMouseButtonDown(0)) { Vector2 worldPosition = GridBuilderUtils.ScreenToWorld(root, Input.mousePosition); DiamondPoint point = map[worldPosition]; if (grid.Contains(point)) { //Toggle the highlight grid[point].HighlightOn = !grid[point].HighlightOn; } } }