Update
This commit is contained in:
@@ -1,70 +0,0 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UI;
|
||||
|
||||
namespace UIEditor
|
||||
{
|
||||
[CustomEditor(typeof(UIManager))]
|
||||
public class UIManagerEditor : UnityEditor.Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
UIManager manager = (UIManager)target;
|
||||
|
||||
// Draw default fields (Initial Screen, Focus Radius, Global Opacity, etc.)
|
||||
base.OnInspectorGUI();
|
||||
|
||||
EditorGUILayout.Space(10);
|
||||
EditorGUILayout.LabelField("GLOBAL STYLING", EditorStyles.boldLabel);
|
||||
|
||||
// Re-sync if opacity slider changes
|
||||
EditorGUI.BeginChangeCheck();
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
manager.SyncScreens();
|
||||
EditorUtility.SetDirty(manager);
|
||||
}
|
||||
|
||||
EditorGUILayout.Space(20);
|
||||
EditorGUILayout.LabelField("QUICK DASHBOARD", EditorStyles.boldLabel);
|
||||
EditorGUILayout.HelpBox("Click các nút dưới đây để xem nhanh giao diện mà không cần Play game.", MessageType.Info);
|
||||
|
||||
if (manager.screens != null)
|
||||
{
|
||||
foreach (var screen in manager.screens)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
// Nút bấm để hiện duy nhất màn hình này
|
||||
if (GUILayout.Button($"SHOW: {screen.screenName}", GUILayout.Height(30)))
|
||||
{
|
||||
manager.ShowOnly(screen.screenName);
|
||||
EditorUtility.SetDirty(manager);
|
||||
}
|
||||
|
||||
// Toggle nhanh trạng thái Active
|
||||
bool newActive = EditorGUILayout.Toggle(screen.isActive, GUILayout.Width(20));
|
||||
if (newActive != screen.isActive)
|
||||
{
|
||||
screen.isActive = newActive;
|
||||
manager.SyncScreens();
|
||||
EditorUtility.SetDirty(manager);
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
}
|
||||
|
||||
EditorGUILayout.Space(10);
|
||||
if (GUILayout.Button("HIDE ALL SCREENS", GUILayout.Height(25)))
|
||||
{
|
||||
foreach (var s in manager.screens) s.isActive = false;
|
||||
manager.SyncScreens();
|
||||
EditorUtility.SetDirty(manager);
|
||||
}
|
||||
|
||||
EditorGUILayout.Space(10);
|
||||
EditorGUILayout.HelpBox("TIP: Bạn có thể thay đổi Global Opacity ở trên để xem độ mờ của toàn bộ UI.", MessageType.None);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0e118f8ca802ae54e92d305688e5b5e3
|
||||
Reference in New Issue
Block a user