Пример #1
0
        public static IZoneNoiseSettings Lerp(ZoneSettings[] zones, ZoneRatio ratio)
        {
            var outScale1 = 0f;
            var outScale2 = 0f;
            var outScale3 = 0f;
            var height = 0f;

            for (int i = 0; i < zones.Length; i++)
            {
                var zoneNoiseSettings = zones[i];
                var zoneRatio = ratio[zoneNoiseSettings.Type];
                height += zoneNoiseSettings.Height*zoneRatio;
                outScale1 += zoneNoiseSettings.OutScale1*zoneRatio;
                outScale2 += zoneNoiseSettings.OutScale2*zoneRatio;
                outScale3 += zoneNoiseSettings.OutScale3*zoneRatio;
            }

            var result = new ZoneSettings2(Color.black, height, outScale1, outScale2, outScale3);

            return result;
        }
Пример #2
0
        public static IZoneNoiseSettings Lerp(ZoneSettings[] zones, ZoneRatio ratio)
        {
            var outScale1 = 0f;
            var outScale2 = 0f;
            var outScale3 = 0f;
            var height    = 0f;

            for (int i = 0; i < zones.Length; i++)
            {
                var zoneNoiseSettings = zones[i];
                var zoneRatio         = ratio[zoneNoiseSettings.Type];
                height    += zoneNoiseSettings.Height * zoneRatio;
                outScale1 += zoneNoiseSettings.OutScale1 * zoneRatio;
                outScale2 += zoneNoiseSettings.OutScale2 * zoneRatio;
                outScale3 += zoneNoiseSettings.OutScale3 * zoneRatio;
            }

            var result = new ZoneSettings2(Color.black, height, outScale1, outScale2, outScale3);

            return(result);
        }