Thank you kindly for the updated information. One way to approach this would be to use a Raycast and check whether what it hits is one of the instantiated cubes.
void Update()
{
if(Input.GetMouseButtonDown(0)) // Left Click
{
// Data to be read out from the Raycast
RaycastHit hit;
// The ray to fire is from the camera to the mouse position
Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
// Then, try the Raycast. If it hits something, the if statement is true
if(Physics.Raycast(ray, out hit, 100))
(
// Inside, check your grid for a GameObject matching the collider of the GameObject hit.
// Note that each cube will need a collider for this method to work, however.
for(int x = 0; x < Width; x++)
{
for(int y = 0; y < Height; y++)
{
if(hit.gameObject == grid[x, y])
Debug.Log("Selected: " + x + "," + y); // Or (x + 1) and (y + 1), as desired
}
}
}
}
}
With this added to your script which generated the cubes, you’ll be able to click on an object and find out which spot it was at.