예제 #1
0
    private void makePlanets()
    {
        float planetAmount = solarSystemSettings.minPlanets + (int)((solarSystemSettings.maxPlanets - solarSystemSettings.minPlanets) * noise.newValueFromCoords(center));
        float orbit        = solarSystemSettings.sunMargin;

        for (int i = 0; i < planetAmount; i++)
        {
            orbit = solarSystemSettings.minSpacing + noise.newValueFromCoords(center);
            PlanetMaker pm = new PlanetMaker(center, orbit);
        }
    }
예제 #2
0
    void OnSceneGUI()
    {
        t = target as PlanetMaker;
        try
        {
            selectedObj = Selection.activeTransform.gameObject;
            if (selectedObj.name == t.name)
            {
                setLightTransform();
                t.distance = Vector3.Distance(t.planet.transform.position, t.viewLight.transform.position);

                if (Event.current.keyCode == KeyCode.A || Event.current.keyCode == KeyCode.S)
                {
                    changeTerrain();
                }
            }
        }
        catch (Exception e)
        {
            Debug.Log(e);
        }
    }
예제 #3
0
    void Start()
    {
        PlanetMaker maker = GetComponent <PlanetMaker>();

        maker.Create();
    }