Пример #1
0
    public SystemManager(Vector3 center, SystemLayout layout)
    {
        this.center = center;
        this.layout = layout;

        this.planets = new List <Planet>();
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        SystemLayout layout = new SystemLayout(minimumSeparationDistance, maximumSeparationDistance, minimumOrbitalVelocity, maximumOrbitalVelocity);

        systemManager = new SystemManager(transform.position, layout);

        for (int i = 0; i < planetCount; i++)
        {
            GameObject prefab = prefabs[Random.Range(0, prefabs.Length)];
            Planet     planet = new Planet(prefab);
            systemManager.AddPlanet(planet);
        }
        systemManager.Draw(planetManager);
        // Only draw these once...or else.
        systemManager.DrawOrbits();
    }