Count blocks via prefab tag

@Rick_Davidson: I decided to try the full challenge, and my idea was to tag the prefab as “Block”, then use .FindGameObjectsWithTag(“Block”) in the Level object’s Start method, having it count the blocks once at the start.

After going through the rest of the video with the solution of having each breakable block increment a public integer, I think:

  • PRO: Each block incrementing seems slower than having Level count them just once.
  • CON: Level would have an inaccurate count of blocks to finish the level if some event created new blocks - or made unbreakable blocks into breakable ones - during play.

Am I thinking correctly about these?

Privacy & Terms