Set an int variable based on distance from an object

Relatively new to Unity and c#, and wondering how to do this. I understand the theory, but I’m lost in practice.

The game is grid based, and each tile will have a security level based on the distance to a security tile. What functions would I use to achieve this?

Thanks in advance!

you can use vector3.distance to find the distance between two points, and set an integer to that. Here’s the unity docs for that