public void instantiateOctant(string name, int x, int y, int z)
{
GameObject entity = GameObject.Find (name);
if (entity == null) {
UnityEngine.Vector3 locationUnity = new UnityEngine.Vector3 (x, y, z);
Transform cube = Instantiate (cubeTransform, locationUnity, Quaternion.identity) as Transform;
cube.Find(UnityConstants.labelTransformPath.TrimStart('/')).guiText.text = name.Substring(UnityConstants.minimapPrefix.Length);
cube.name = name;
cube.renderer.material.SetColor ("_Color", new Color (0.5f, 0.5f, 0.5f, 0.5f));
cube.renderer.material.shader = Shader.Find ("Transparent/Diffuse");
// Whenever there's an octant being instantiated, enable the asteroid that's in there
List<int> octList = CommonUtility.getOctantIndicesFromVector3 (new remap.NDNMOG.DiscoveryModule.Vector3 (x, y, z));
for (int i = 0; i < UnityConstants.treeNum * UnityConstants.scenarioNum; i++) {
if (inOct ((int)asteroids [i].position.x, (int)asteroids [i].position.y, (int)asteroids [i].position.z, octList)) {
toggleVisibility (asteroids [i], true);
}
}
} else {
//Debug.Log("octant " + name + " already instantiated.");
}
}