Created
December 18, 2014 16:51
-
-
Save pandr/c980aa350c14d14080a1 to your computer and use it in GitHub Desktop.
Nissehue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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