public void UpdateSettings(ColorSettings colorSettings)
 {
     _colorSettings = colorSettings;
     if (_texture == null)
     {
         _texture = new Texture2D(_textureResolution, 1);
     }
 }
Example #2
0
        public GameObject CreatePlanet(Vector3 position, ColorSettings settings)
        {
            GameObject planet = new GameObject("Planet");

            planet.transform.position = position;

            var planetComponent = planet.AddComponent <Planet>();

            planetComponent.ColorSettings       = settings;
            planetComponent.Resolution          = _resolution;
            planetComponent.FaceCount           = _faceCount;
            planetComponent.PlanetNoiseSettings = new NoiseSettings[6];
            if (settings == _hot)
            {
                planetComponent.PlanetNoiseSettings[0] = new NoiseSettings(1, 8, 1, planet.transform.position, NoiseSettings.NoiseTypes.Soft);
                planetComponent.PlanetNoiseSettings[1] = new NoiseSettings(1, 16, 2, planet.transform.position, NoiseSettings.NoiseTypes.Soft);
            }
            planetComponent.UpdatePlanetMesh();

            CurrentPlanet = planet;

            return(planet);
        }