Skip to content

Instantly share code, notes, and snippets.

@pandr
Created December 18, 2014 16:51
Show Gist options
  • Save pandr/c980aa350c14d14080a1 to your computer and use it in GitHub Desktop.
Save pandr/c980aa350c14d14080a1 to your computer and use it in GitHub Desktop.
Nissehue
using UnityEngine;
using System.Collections;
public class Creator : MonoBehaviour {
// Use this for initialization
void Start () {
for (int h = 0; h < 10; h++)
{
float he = (float)h*0.1f;
for (int i = 0; i < 20; i++)
{
float deg = (float)2.0f*3.1415f*i/20.0f;
var c = GameObject.CreatePrimitive (PrimitiveType.Sphere);
float r = 1.0f-he;
c.transform.position = new Vector3(Mathf.Sin(deg)*r, he*2.0f, Mathf.Cos(deg)*r);
c.transform.localScale = Vector3.one * 0.6f;
c.renderer.material.color = (h==0 || h == 9) ? Color.white : Color.red;
}
}
}
// Update is called once per frame
void Update () {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment