Hla, long time listner, first time caller ;)
I am making a bejewel clone with a twist ;) for the android platform. But I am a little unsure how I get hold of the sprite after a finger touch. Time for some code. (snippet is from Update)
As you can see I need to get hold of the sprite which contains the selected gem, so I can highlight/animate/remove it.
I though of putting the spirte into the Gem script as a public var or perhaps use an ID in the tag and run through all the sprites and find the corresponding sprite to the gameobject. But there most be an easier way.. :)
asked Mar 15 '11 at 11:36 AM
This will get you the Gem script of the object you touched.
If you have a Sprite script attached to it do:
If the Sprite is a child of the Gem object I'd expose the sprite as a public variable or property of the Gem script.
answered Mar 15 '11 at 11:56 AM