Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
List<GameObject> prefabs;
void InstantiateCubesInCircle(){
for (int i = 1; i <= batchNum; i++){
Vector2 position = Random.insideUnitCircle;
position.x = position.x * cubeSize.x / 2f + offset.x;
position.y = position.y * cubeSize.y / 2f + offset.y;
// Prefabをインスタンス化する
GameObject prefab = prefabs[Random.Range(0, prefabs.Count - 1)];
GameObject obj = Instantiate(prefab, position, Quaternion.identity);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.