Пример #1
0
        public SkyTarget CurSkyTarget(Map map)
        {
            float num  = GenCelestial.CurCelestialSunGlow(map);
            int   num2 = 0;
            int   num3 = 0;

            for (int i = 0; i < skyTargets.Length; i++)
            {
                num3 = i;
                if (num + 0.001f < skyTargets[i].celGlowThreshold)
                {
                    break;
                }
                num2 = i;
            }
            SkyThreshold skyThreshold  = skyTargets[num2];
            SkyThreshold skyThreshold2 = skyTargets[num3];
            float        num4          = skyThreshold2.celGlowThreshold - skyThreshold.celGlowThreshold;
            float        t             = (num4 != 0f) ? ((num - skyThreshold.celGlowThreshold) / num4) : 1f;
            SkyTarget    result        = default(SkyTarget);

            result.glow   = num;
            result.colors = SkyColorSet.Lerp(skyThreshold.colors, skyThreshold2.colors, t);
            if (GenCelestial.IsDaytime(num))
            {
                result.lightsourceShineIntensity = 1f;
                result.lightsourceShineSize      = 1f;
            }
            else
            {
                result.lightsourceShineIntensity = 0.7f;
                result.lightsourceShineSize      = 0.5f;
            }
            return(result);
        }
Пример #2
0
 public SkyTarget(float glow, SkyColorSet colorSet, float lightsourceShineSize, float lightsourceShineIntensity)
 {
     this.glow = glow;
     this.lightsourceShineSize      = lightsourceShineSize;
     this.lightsourceShineIntensity = lightsourceShineIntensity;
     colors = colorSet;
 }
Пример #3
0
        public static SkyTarget LerpDarken(SkyTarget A, SkyTarget B, float t)
        {
            SkyTarget result = default(SkyTarget);

            result.colors = SkyColorSet.Lerp(A.colors, B.colors, t);
            result.glow   = Mathf.Lerp(A.glow, Mathf.Min(A.glow, B.glow), t);
            result.lightsourceShineSize      = Mathf.Lerp(A.lightsourceShineSize, Mathf.Min(A.lightsourceShineSize, B.lightsourceShineSize), t);
            result.lightsourceShineIntensity = Mathf.Lerp(A.lightsourceShineIntensity, Mathf.Min(A.lightsourceShineIntensity, B.lightsourceShineIntensity), t);
            return(result);
        }
Пример #4
0
        public static SkyColorSet Lerp(SkyColorSet A, SkyColorSet B, float t)
        {
            SkyColorSet result = default(SkyColorSet);

            result.sky        = Color.Lerp(A.sky, B.sky, t);
            result.shadow     = Color.Lerp(A.shadow, B.shadow, t);
            result.overlay    = Color.Lerp(A.overlay, B.overlay, t);
            result.saturation = Mathf.Lerp(A.saturation, B.saturation, t);
            return(result);
        }
Пример #5
0
 public static SkyTarget LerpDarken(SkyTarget A, SkyTarget B, float t)
 {
     return(new SkyTarget
     {
         colors = SkyColorSet.Lerp(A.colors, B.colors, t),
         glow = Mathf.Lerp(A.glow, Mathf.Min(A.glow, B.glow), t),
         lightsourceShineSize = Mathf.Lerp(A.lightsourceShineSize, Mathf.Min(A.lightsourceShineSize, B.lightsourceShineSize), t),
         lightsourceShineIntensity = Mathf.Lerp(A.lightsourceShineIntensity, Mathf.Min(A.lightsourceShineIntensity, B.lightsourceShineIntensity), t)
     });
 }
Пример #6
0
 public static SkyColorSet Lerp(SkyColorSet A, SkyColorSet B, float t)
 {
     return(new SkyColorSet
     {
         sky = Color.Lerp(A.sky, B.sky, t),
         shadow = Color.Lerp(A.shadow, B.shadow, t),
         overlay = Color.Lerp(A.overlay, B.overlay, t),
         saturation = Mathf.Lerp(A.saturation, B.saturation, t)
     });
 }
        public SkyTarget CurSkyTarget(Map map)
        {
            float num  = GenCelestial.CurCelestialSunGlow(map);
            int   num2 = 0;
            int   num3 = 0;
            int   num4 = 0;

            while (num4 < this.skyTargets.Length)
            {
                num3 = num4;
                if (!(num + 0.0010000000474974513 < this.skyTargets[num4].celGlowThreshold))
                {
                    num2 = num4;
                    num4++;
                    continue;
                }
                break;
            }
            SkyThreshold skyThreshold  = this.skyTargets[num2];
            SkyThreshold skyThreshold2 = this.skyTargets[num3];
            float        num5          = skyThreshold2.celGlowThreshold - skyThreshold.celGlowThreshold;
            float        t             = (float)((num5 != 0.0) ? ((num - skyThreshold.celGlowThreshold) / num5) : 1.0);
            SkyTarget    result        = default(SkyTarget);

            result.glow   = num;
            result.colors = SkyColorSet.Lerp(skyThreshold.colors, skyThreshold2.colors, t);
            if (GenCelestial.IsDaytime(num))
            {
                result.lightsourceShineIntensity = 1f;
                result.lightsourceShineSize      = 1f;
            }
            else
            {
                result.lightsourceShineIntensity = 0.7f;
                result.lightsourceShineSize      = 0.5f;
            }
            return(result);
        }
Пример #8
0
 public SkyThreshold(SkyColorSet colors, float celGlowThreshold)
 {
     this.colors           = colors;
     this.celGlowThreshold = celGlowThreshold;
 }