Change object's texture aimed with crosshair

I did tried to search but can’t find the answer but am sure it was somewhere around.
Basically I want to cycle through the object’s texture with a click of the button when the crosshair is aimed at a particular objects.

There is an example on youtube: Real Time Architecture Visualization unity3d - YouTube

and the Unity Player sample: http://www.camiloalcaraz.com/index.php?p=2_7

Thanks in advance.

“When the crosshair is aimed at particular objects” is one problem.
“cycle through the object’s texture” is a second, separate problem.
Solve them one at a time.

The basic solution is that each object whose texture can change needs to be the same tag, that is returned
by a raycast. And each of those objects have a script with a Material variable.

Set the renderer’s material to the next element in the array unless you are already at the last element, then set it to the first.