Last active
April 16, 2024 13:09
-
-
Save v0xel1337/3a46a5daa62317421086135ce25a1b42 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void CreateMines() | |
{ | |
while (mineCount > 0) | |
{ | |
int index = Random.Range(0, base.transform.childCount); | |
GameObject gameObject = base.transform.GetChild(index).gameObject; | |
if (gameObject != null) | |
{ | |
if (!gameObject.GetComponent<MinePlate>().isMine) | |
{ | |
gameObject.GetComponent<MinePlate>().isMine = true; | |
gameObject.GetComponent<MinePlate>().UpdateNearbyTileMineCounts(); | |
mineCount--; | |
} | |
continue; | |
} | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment