3 in a row puzzle game

How do I set up a system that will check if an object is part of a three in a row or more match and then destroy all those in it?

Like a typical puzzle game?

I was considering using raycast in all directions but destroying the matching items alone has me in a slump. I know I need to do something with booleans.

I've actually been playing around with match-3 type games recently. From looking around, the popular way seems to be using arrays to handle all the logic. That way you have a framework and can use logic on the arrays versus trying to use the physics and spatial relations with game objects.

Essentially,

  1. Build your array
  2. create game objects to represent the elements in your array
  3. manipulate the array
  4. mirror manipulation to gameobjects

...or something to that effect. Hope this helps!

Also: http://answers.unity3d.com/questions/4841/match-3-puzzle-game