Ejemplo n.º 1
0
 private float[,] modByCurve(float[,] noiseMap, noiseGenerator.curve modCurve)
 {
     float[,] temp = new float[noiseMap.GetLength(0), noiseMap.GetLength(1)];
     for (int i = 0; i < noiseMap.GetLength(0); i++)
     {
         for (int j = 0; j < noiseMap.GetLength(1); j++)
         {
             temp[i, j] = modCurve(noiseMap[i, j]);
         }
     }
     return(temp);
 }
Ejemplo n.º 2
0
    void Start()
    {
        sin = delegate(float x) { return((Mathf.Cos((x + 1) * Mathf.PI) + 1) / 2); };

        hugeMountainNoise = (Instantiate(noiseMap) as GameObject).GetComponent <noiseGenerator>();
        hugeMountainNoise.init(12000, SEED, 1f / 4000000000f, "hugeMountainNoise", gameObject);
        hugeMountainPostMod = delegate(float x) { return(8000 * x); };

        testNoise = (Instantiate(noiseMap) as GameObject).GetComponent <noiseGenerator>();
        testNoise.init(20, SEED + 1, "testNoise", gameObject);
        testPostMod = delegate(float x) { return(7 * x); };

        StartCoroutine(chunkGenerator());
    }