Quantcast
Channel: Answers by "Graham-Dunnett"
Viewing all articles
Browse latest Browse all 959

Answer by Graham Dunnett

$
0
0
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.

Viewing all articles
Browse latest Browse all 959

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>