Skip to content

Instantly share code, notes, and snippets.

@boj
Created June 21, 2011 14:37
Show Gist options
  • Save boj/1037990 to your computer and use it in GitHub Desktop.
Save boj/1037990 to your computer and use it in GitHub Desktop.
Cube Test
using UnityEngine;
using System.Collections;
public class SystemController : MonoBehaviour {
const int size = 64;
public GameObject[][] cubes = new GameObject[size][];
public GameObject clone_cube;
void Awake() {
clone_cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
//clone_cube.renderer.material.shader = Shader.Find("Bojo");
for (int i = 0; i < cubes.Length; i++) {
cubes[i] = new GameObject[size];
}
for (int i = 0; i < cubes.Length; i++) {
for (int j = 0; j < cubes[i].Length; j++) {
cubes[i][j] = Instantiate(clone_cube, new Vector3((i * 1.5F) - (size / 2), (j * 1.5F) - (size / 2), size * 2), Quaternion.identity) as GameObject;
}
}
clone_cube.renderer.enabled = false;
}
void Start() {
}
void Update() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment