Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Update()

void Terraria.Graphics.Effects.OverlayManager.Update ( GameTime gameTime)
inline

Definition at line 51 of file OverlayManager.cs.

52 {
53 for (int i = 0; i < _activeOverlays.Length; i++)
54 {
56 while (linkedListNode != null)
57 {
58 Overlay value = linkedListNode.Value;
60 value.Update(gameTime);
61 switch (value.Mode)
62 {
63 case OverlayMode.Active:
64 value.Opacity = Math.Min(1f, value.Opacity + (float)gameTime.ElapsedGameTime.TotalSeconds * 1f);
65 break;
66 case OverlayMode.FadeIn:
67 value.Opacity += (float)gameTime.ElapsedGameTime.TotalSeconds * 1f;
68 if (value.Opacity >= 1f)
69 {
70 value.Opacity = 1f;
71 value.Mode = OverlayMode.Active;
72 }
73 break;
74 case OverlayMode.FadeOut:
75 value.Opacity -= (float)gameTime.ElapsedGameTime.TotalSeconds * 1f;
76 if (value.Opacity <= 0f)
77 {
78 value.Opacity = 0f;
79 value.Mode = OverlayMode.Inactive;
82 }
83 break;
84 }
85 linkedListNode = next;
86 }
87 }
88 }
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
static byte Min(byte val1, byte val2)
Definition Math.cs:912

References Terraria.Graphics.Effects.OverlayManager._activeOverlays, Terraria.Graphics.Effects.OverlayManager._overlayCount, System.Math.Min(), System.Collections.Generic.Dictionary< TKey, TValue >.Remove(), and System.value.