How to find an element in a Rect array as an int?

I have an array of Rects and I want to isolate the elements as integers. For example: Display an array of Rect positions on screen. Click Rect 1 return that specific Rect element as an integer in the array. I hope that makes sense.

Thank you.

Um it might make sense!


   import System.Linq;


    var index = myArrayOfRects.FindIndex(function(r) { return r.Contains(Input.mousePosition); });


    using System.Linq;


    var index = myArrayOfRects.FindIndex(r=>r.Contains(Input.mousePosition));