Jo Jo funguje Kappa
This commit is contained in:
@@ -80,24 +80,45 @@ namespace MegaKoop.UI
|
||||
// Steam Integration
|
||||
private SteamLobbyService steam;
|
||||
|
||||
private bool _initialized;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (uiDocument == null)
|
||||
uiDocument = GetComponent<UIDocument>();
|
||||
|
||||
if (uiDocument != null)
|
||||
{
|
||||
root = uiDocument.rootVisualElement;
|
||||
InitializeElements();
|
||||
RegisterEvents();
|
||||
EnsureSteamServices();
|
||||
RegisterSteamEvents();
|
||||
SetupInitialState();
|
||||
}
|
||||
else
|
||||
|
||||
if (uiDocument == null)
|
||||
{
|
||||
Debug.LogError("UIDocument not found on MultiplayerLobbyController!");
|
||||
return;
|
||||
}
|
||||
|
||||
root = uiDocument.rootVisualElement;
|
||||
if (root == null)
|
||||
{
|
||||
Debug.LogError("rootVisualElement is null on MultiplayerLobbyController!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize only after attached to a panel to avoid DPI/pixelsPerPoint issues
|
||||
root.RegisterCallback<AttachToPanelEvent>(OnAttachedToPanel);
|
||||
if (root.panel != null)
|
||||
{
|
||||
// Already attached (domain reload case)
|
||||
OnAttachedToPanel(default);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnAttachedToPanel(AttachToPanelEvent evt)
|
||||
{
|
||||
if (_initialized) return;
|
||||
_initialized = true;
|
||||
|
||||
InitializeElements();
|
||||
RegisterEvents();
|
||||
EnsureSteamServices();
|
||||
RegisterSteamEvents();
|
||||
SetupInitialState();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
|
||||
Reference in New Issue
Block a user