using UnityEngine;
using System.Collections;

public class Create_Crystals : MonoBehaviour {


    public GameObject Crystal = null;
    public int max_crystals = 10;
    public float angle_inc = 36.0f;

    public GameObject[] crystal_list= null;
    public bool CrystalPlacementDone = false;
	// Use this for initialization
	void Start () {
        if (Crystal == null)
            return;

        //float angle = 0;

        crystal_list = new GameObject[2 * max_crystals];

        Quaternion rot = Quaternion.Euler(0, angle_inc, 0);
        Vector3 pos = new Vector3(0.75f, 0.25f, 0);

        for (int crystal_cnt = 0; crystal_cnt < max_crystals; crystal_cnt++)
        {
            pos = rot*pos;

            crystal_list[crystal_cnt] = (GameObject) Instantiate(Crystal, pos, new Quaternion(1,0,0,0));
        }

        pos = new Vector3(0.35f, 0.25f, 0);


        for (int crystal_cnt = 0; crystal_cnt < max_crystals; crystal_cnt++)
        {
            pos = rot * pos;

            crystal_list[crystal_cnt + max_crystals] = (GameObject)Instantiate(Crystal, pos, new Quaternion(1, 0, 0, 0));
        }

        CrystalPlacementDone = true;


	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
