Exemple #1
0
    private void Generate_Planets()
    {
        int orbitCount = Random.Range(2, 8);

        orbits = new Stellar_Orbit[orbitCount];
        int range = 0;

        int[] zones = new int[orbitCount];

        for (int i = 0; i < zones.Length; i++)
        {
            zones[i] = Random.Range(0, 5);
        }

        zones = ReOrder_Zones(zones);

        for (int i = 0; i < orbitCount; i++)
        {
            GameObject    orbit_Obj = Instantiate(orbit_Prefab);
            Stellar_Orbit orbit     = orbit_Obj.GetComponent <Stellar_Orbit>();

            orbits[i] = orbit;

            orbit_Obj.transform.SetParent(transform, false);

            orbit.Activate(host_Star, zones[i], range);

            range++;
        }
    }
Exemple #2
0
    public void Hide_System()
    {
        Rotate_To_Default();

        for (int i = 0; i < orbits.Length; i++)
        {
            Stellar_Orbit item = orbits[i];

            item.Hide();
        }
    }
Exemple #3
0
    public void View_System()
    {
        Rotate_To_Default();
        rotator.enabled = true;

        for (int i = 0; i < orbits.Length; i++)
        {
            Stellar_Orbit item = orbits[i];

            item.View();
            item.Set_View_Rotation();
        }

        currentState = ringState.SYSTEM;
    }
Exemple #4
0
    public void Check_System()
    {
        rotator.enabled = false;
        Rotate_To_Default();

        for (int i = 0; i < orbits.Length; i++)
        {
            Stellar_Orbit item = orbits[i];

            item.View();
            item.Set_Check_Rotation();
        }

        currentState = ringState.STAR;
    }
Exemple #5
0
 public void Set_Stellar_Orbit(Stellar_Orbit stellarOrbit)
 {
     orbit_Controller = stellarOrbit;
 }