67 {
68 nightlightPower = 0f;
69 daylightPower = 0f;
70 moonPower = 0f;
71 Vector2 dayTimeAsDirectionIn24HClock = Utils.GetDayTimeAsDirectionIn24HClock();
72 Vector2 dayTimeAsDirectionIn24HClock2 = Utils.GetDayTimeAsDirectionIn24HClock(4.5f);
73 Vector2 dayTimeAsDirectionIn24HClock3 = Utils.GetDayTimeAsDirectionIn24HClock(0f);
74 float fromValue =
Vector2.
Dot(dayTimeAsDirectionIn24HClock, dayTimeAsDirectionIn24HClock3);
75 float fromValue2 =
Vector2.
Dot(dayTimeAsDirectionIn24HClock, dayTimeAsDirectionIn24HClock2);
76 nightlightPower = Utils.Remap(fromValue, -0.2f, 0.1f, 0f, 1f);
77 daylightPower = Utils.Remap(fromValue, 0.1f, -1f, 0f, 1f);
78 dawnPower = Utils.Remap(fromValue2, 0.66f, 1f, 0f, 1f);
79 if (!Main.dayTime)
80 {
81 float num = (float)(Main.time / 32400.0) * 2f;
82 if (num > 1f)
83 {
84 num = 2f - num;
85 }
86 moonPower = Utils.Remap(num, 0f, 0.25f, 0f, 1f);
87 }
88 }
static float Dot(Vector2 value1, Vector2 value2)