How do I chose 1 out of 2 numbers

Hi,
i want to chose 1 out of 2 numbers (1 and 2) and make a code that goes something like this: if 1 then spawn if 2 then no spawn.
also i want to be able to reference this with other objects. i am making a spelunky type game and i have a 4 by 4 grid each with a 10 by 10 grid inside them(smaller grid is child). i want to be able to disable them and enable them so they make the level. I have disabled them all at start up and have already listed them so i can just plug in the names in the code. this code will go something like this: if 1 then enable (insert multiple child objects here) if is 2 (insert diferent child objects here)

Thanks in advance

Good day.

you need the function Random.Range (look that you can do it with float and int)

int number = Random.Range (1,2);

Bye!

You need to write some conditional code depending upon your selection of number write some if/else blocks to further implement your game logic. If user selects 1 then your take it to further 4x4 grid logic and after that take user to 10x10 logic. You can use Even/Odd logic. If user selects 1 use only odd indexed number childs, if 2 then use even numbers child.