コード例 #1
0
        public static void GetSeason(float yearPct, float latitude, out float spring, out float summer, out float fall, out float winter, out float permanentSummer, out float permanentWinter)
        {
            yearPct = Mathf.Clamp01(yearPct);
            float num  = default(float);
            float num2 = default(float);
            float num3 = default(float);

            LatitudeSectionUtility.GetLatitudeSection(latitude, out num, out num2, out num3);
            float num4 = default(float);
            float num5 = default(float);
            float num6 = default(float);
            float num7 = default(float);

            SeasonUtility.GetSeasonalAreaSeason(yearPct, out num4, out num5, out num6, out num7, true);
            float num8  = default(float);
            float num9  = default(float);
            float num10 = default(float);
            float num11 = default(float);

            SeasonUtility.GetSeasonalAreaSeason(yearPct, out num8, out num9, out num10, out num11, false);
            float num12 = Mathf.InverseLerp(-2.5f, 2.5f, latitude);
            float num13 = (float)(num12 * num4 + (1.0 - num12) * num8);
            float num14 = (float)(num12 * num5 + (1.0 - num12) * num9);
            float num15 = (float)(num12 * num6 + (1.0 - num12) * num10);
            float num16 = (float)(num12 * num7 + (1.0 - num12) * num11);

            spring          = num13 * num2;
            summer          = num14 * num2;
            fall            = num15 * num2;
            winter          = num16 * num2;
            permanentSummer = num;
            permanentWinter = num3;
        }
コード例 #2
0
        public static void GetSeason(float yearPct, float latitude, out float spring, out float summer, out float fall, out float winter, out float permanentSummer, out float permanentWinter)
        {
            yearPct = Mathf.Clamp01(yearPct);
            float num;
            float num2;
            float num3;

            LatitudeSectionUtility.GetLatitudeSection(latitude, out num, out num2, out num3);
            float num4;
            float num5;
            float num6;
            float num7;

            SeasonUtility.GetSeasonalAreaSeason(yearPct, out num4, out num5, out num6, out num7, true);
            float num8;
            float num9;
            float num10;
            float num11;

            SeasonUtility.GetSeasonalAreaSeason(yearPct, out num8, out num9, out num10, out num11, false);
            float num12 = Mathf.InverseLerp(-2.5f, 2.5f, latitude);
            float num13 = num12 * num4 + (1f - num12) * num8;
            float num14 = num12 * num5 + (1f - num12) * num9;
            float num15 = num12 * num6 + (1f - num12) * num10;
            float num16 = num12 * num7 + (1f - num12) * num11;

            spring          = num13 * num2;
            summer          = num14 * num2;
            fall            = num15 * num2;
            winter          = num16 * num2;
            permanentSummer = num;
            permanentWinter = num3;
        }
コード例 #3
0
        public static LatitudeSection GetReportedLatitudeSection(float latitude)
        {
            float num;
            float num2;
            float num3;

            LatitudeSectionUtility.GetLatitudeSection(latitude, out num, out num2, out num3);
            LatitudeSection result;

            if (num == 0f && num2 == 0f && num3 == 0f)
            {
                result = LatitudeSection.Undefined;
            }
            else if (num == 1f)
            {
                result = LatitudeSection.Equatorial;
            }
            else if (num3 == 1f)
            {
                result = LatitudeSection.Polar;
            }
            else
            {
                result = LatitudeSection.Seasonal;
            }
            return(result);
        }
コード例 #4
0
        public static LatitudeSection GetDominantLatitudeSection(float latitude)
        {
            float num  = default(float);
            float num2 = default(float);
            float num3 = default(float);

            LatitudeSectionUtility.GetLatitudeSection(latitude, out num, out num2, out num3);
            if (num == 0.0 && num2 == 0.0 && num3 == 0.0)
            {
                return(LatitudeSection.Undefined);
            }
            return(GenMath.MaxBy(LatitudeSection.Equatorial, num, LatitudeSection.Seasonal, num2, LatitudeSection.Polar, num3));
        }
コード例 #5
0
        public static void GetSeason(float yearPct, float latitude, out float spring, out float summer, out float fall, out float winter, out float permanentSummer, out float permanentWinter)
        {
            yearPct = Mathf.Clamp01(yearPct);
            LatitudeSectionUtility.GetLatitudeSection(latitude, out var equatorial, out var seasonal, out var polar);
            GetSeasonalAreaSeason(yearPct, out var spring2, out var summer2, out var fall2, out var winter2, northernHemisphere: true);
            GetSeasonalAreaSeason(yearPct, out var spring3, out var summer3, out var fall3, out var winter3, northernHemisphere: false);
            float num  = Mathf.InverseLerp(-2.5f, 2.5f, latitude);
            float num2 = num * spring2 + (1f - num) * spring3;
            float num3 = num * summer2 + (1f - num) * summer3;
            float num4 = num * fall2 + (1f - num) * fall3;
            float num5 = num * winter2 + (1f - num) * winter3;

            spring          = num2 * seasonal;
            summer          = num3 * seasonal;
            fall            = num4 * seasonal;
            winter          = num5 * seasonal;
            permanentSummer = equatorial;
            permanentWinter = polar;
        }
コード例 #6
0
        public static LatitudeSection GetDominantLatitudeSection(float latitude)
        {
            float num;
            float num2;
            float num3;

            LatitudeSectionUtility.GetLatitudeSection(latitude, out num, out num2, out num3);
            LatitudeSection result;

            if (num == 0f && num2 == 0f && num3 == 0f)
            {
                result = LatitudeSection.Undefined;
            }
            else
            {
                result = GenMath.MaxBy <LatitudeSection>(LatitudeSection.Equatorial, num, LatitudeSection.Seasonal, num2, LatitudeSection.Polar, num3);
            }
            return(result);
        }
コード例 #7
0
        public static LatitudeSection GetReportedLatitudeSection(float latitude)
        {
            float num  = default(float);
            float num2 = default(float);
            float num3 = default(float);

            LatitudeSectionUtility.GetLatitudeSection(latitude, out num, out num2, out num3);
            if (num == 0.0 && num2 == 0.0 && num3 == 0.0)
            {
                return(LatitudeSection.Undefined);
            }
            if (num == 1.0)
            {
                return(LatitudeSection.Equatorial);
            }
            if (num3 == 1.0)
            {
                return(LatitudeSection.Polar);
            }
            return(LatitudeSection.Seasonal);
        }