Animace + Menu

This commit is contained in:
Dominik G.
2025-10-05 18:18:12 +02:00
parent b52b3aa830
commit 550efdfaad
2192 changed files with 602748 additions and 2703 deletions

View File

@@ -0,0 +1,39 @@
using UnityEngine;
using UnityEngine.UIElements;
namespace MegaKoop.UI
{
/// <summary>
/// Ensures Panel Settings are configured for proper scaling across all resolutions
/// </summary>
[RequireComponent(typeof(UIDocument))]
public class PanelSettingsSetup : MonoBehaviour
{
private void Awake()
{
var uiDocument = GetComponent<UIDocument>();
if (uiDocument != null && uiDocument.panelSettings != null)
{
var settings = uiDocument.panelSettings;
// Set Scale Mode to Scale With Screen Size for responsive design
settings.scaleMode = PanelScaleMode.ScaleWithScreenSize;
// Reference resolution (base design resolution)
settings.referenceResolution = new Vector2Int(1920, 1080);
// Match width or height (0.5 = balanced)
settings.match = 0.5f;
// Sort order
settings.sortingOrder = 0;
Debug.Log($"Panel Settings configured for responsive design: {settings.scaleMode}");
}
else
{
Debug.LogWarning("UIDocument or PanelSettings not found! UI may not scale properly.");
}
}
}
}