Hello,
I have a button in a shape of an ellipse, and my problem is that it needs to be VERY accurate (its surrounded by other buttons, like:
http://pokit.org/get/?92892c47e8257f70dc7df4e977b5b284.jpg )
and they are all GUI textures. My problem is that they are all gui textures and currently im just checking if the mouse click position is contained in their location + scale rect.
If anyone could help me here would be great.
aaand solved it by random guessing!
tried printing all kinda info available till I got to this:
code:
var tex : Texture2D;
tex = transform.guiTexture.texture;
print(tex.GetPixel( Input.mousePosition.x, Input.mousePosition.y ) );
when its not transparent:
RGBA(0.651, 0.808, 0.227, 1.000)
when its transparent:
RGBA(1.000, 1.000, 1.000, 0.000)
the last float ( Alpha ) was all I needed to monitor to check before executing the on click part of the code