Exemplo n.º 1
0
 private void Start()
 {
     planet      = this.GetComponentInParent <Planet>();
     noiseFilter = NoiseFilterFactory.CreateNoisefilter(noiseSettings, 0);
     GenerateTexture();
     perlin          = new Noise(UnityEngine.Random.Range(0, int.MaxValue));
     oldPerlin       = new Noise(UnityEngine.Random.Range(0, int.MaxValue));
     textureModifier = TextureModifierFactory.CreateTextureModifier(settings.noiseAnimatorType);
 }
Exemplo n.º 2
0
    public void UpdateSettings(ShapeSettings settings)
    {
        this.settings = settings;
        INoiseFilter[] oldFilters = noiseFilters;
        noiseFilters = new INoiseFilter[settings.noiseLayers.Length];

        for (int i = 0; i < noiseFilters.Length; i++)
        {
            int seed = oldFilters != null? oldFilters[i] != null? oldFilters[i].GetSeed() : 0 : 0;
            noiseFilters[i] = NoiseFilterFactory.CreateNoisefilter(settings.noiseLayers[i].noiseSettings, seed);
        }
        elevationMinMax = new MinMax();
    }