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); } }
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); } }
void Start() { PlanetMaker maker = GetComponent <PlanetMaker>(); maker.Create(); }