Пример #1
0
        public List <HeightmapArray> GenerateErodedArrays(HeightmapArray baseArray,
                                                          List <MeiHydraulicEroderConfiguration> configurations)
        {
            var msw = new MyStopWatch();
            List <HeightmapArray> outArray = new List <HeightmapArray>();
            int i = 0;

            foreach (var aConfiguration in configurations)
            {
                var copyArray          = MyArrayUtils.DeepClone(baseArray.HeightmapAsArray);
                var currentHeightArray = new SimpleHeightArray(copyArray);
                msw.StartSegment("eroding-" + i);
                var eroder = new MeiHydraulicEroder();
                eroder.Erode(currentHeightArray, aConfiguration);
                msw.StopSegment();

                outArray.Add(SimpleHeightArray.ToHeightmap(currentHeightArray));
                i++;
            }
            Debug.Log("T22: " + msw.CollectResults());
            return(outArray);
        }