private static void SetActiveOverlay(Type type, UIOverlay overlay) { if (ActiveOverlays.TryGetValue(type, out var existingOverlay)) { throw new InvalidOperationException($"Cannot set two of the same overlay active at a time. Type: `{type}."); } ActiveOverlays.Add(type, overlay); overlay.SetVisible(true); overlay.transform.SetParent(OverlayLayer, false); }
private static void SetOverlayVisibility(UIOverlay overlay, bool isVisible) => overlay.SetVisible(isVisible);