Animace + Menu
This commit is contained in:
38
UI/Editor/CreatePanelSettings.cs
Normal file
38
UI/Editor/CreatePanelSettings.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace MegaKoop.UI.Editor
|
||||
{
|
||||
public static class CreatePanelSettings
|
||||
{
|
||||
[MenuItem("Assets/Create/UI Toolkit/Panel Settings Asset (Custom)", false, 10)]
|
||||
public static void CreatePanelSettingsAsset()
|
||||
{
|
||||
// Vytvoření Panel Settings instance
|
||||
var panelSettings = ScriptableObject.CreateInstance<PanelSettings>();
|
||||
|
||||
// Základní nastavení
|
||||
panelSettings.scaleMode = PanelScaleMode.ConstantPixelSize;
|
||||
panelSettings.scale = 1.0f;
|
||||
panelSettings.fallbackDpi = 96;
|
||||
panelSettings.referenceDpi = 96;
|
||||
panelSettings.referenceResolution = new Vector2Int(1920, 1080);
|
||||
panelSettings.screenMatchMode = PanelScreenMatchMode.MatchWidthOrHeight;
|
||||
panelSettings.match = 0.5f;
|
||||
panelSettings.sortingOrder = 0;
|
||||
|
||||
// Uložení assetu
|
||||
string path = "Assets/UI/MainMenuPanelSettings.asset";
|
||||
AssetDatabase.CreateAsset(panelSettings, path);
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
|
||||
// Výběr vytvořeného assetu
|
||||
Selection.activeObject = panelSettings;
|
||||
EditorGUIUtility.PingObject(panelSettings);
|
||||
|
||||
Debug.Log($"Panel Settings asset vytvořen: {path}");
|
||||
}
|
||||
}
|
||||
}
|
||||
2
UI/Editor/CreatePanelSettings.cs.meta
Normal file
2
UI/Editor/CreatePanelSettings.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 99f1a90753825dd458f7510a9a178504
|
||||
Reference in New Issue
Block a user