I'd think I'd have two static arrays `Matched` and `UnMatched`. Add all the puzzle pieces to the `UnMatched` array when you start up. (Perhaps in `Start()` for each game object.) Then as the player moves a piece to the right location, move the game object from the `UnMatched` array to the `Matched` array. You can then have code that looks at the number of entries in the `UnMatched` array. Once it falls to zero, you know you have all the pieces in their correct locations.
See:
https://unity3d.com/learn/tutorials/modules/intermediate/scripting/statics
if you need help understanding why the arrays should be static.
↧