private Quaternion[] rotationValue;
private Color[] colorValue;
voidStart(){
rotationValue = new Quaternion[12];
colorValue = new Color[12];
inti=0;
while(i<rotationValue.Length){
rotationValue[i ]= Random.rotation;
//生成随机颜色
colorValue[i] = newColor(Random.value,Random.value,Random.value);
Transform child = transform.GetChild(i);
child.rotation=rotationValue[i];
Renderer render=child.GetComponent();
render.material.color=colorValue[i];
i++;
}
}
网友评论