Last active
August 29, 2015 14:00
-
-
Save radicaled/11341547 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
// Still incorrect, but less incorrect. | |
var itemOne : GameObject; | |
var itemTwo : GameObject; | |
var objects : new Array(); | |
objects.Push(itemOne); | |
objects.Push(itemTwo); | |
// Make one of each object. | |
for(var i : int; i < objects.length; i++) { | |
var object = objects[i]; | |
Instantiate(object, /* ... other parameters ... */); | |
} | |
// Alternatively, 20 random objects. | |
for(var i : int; i < objects.length; i++) { | |
var object = objects[Random.range(0, 20)]; | |
Instantiate(object, /* ... other parameters ... */); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment