This commit is contained in:
Mikhail 2024-03-10 09:29:21 +08:00
parent 1d2fa0ad72
commit c8a199d412
5 changed files with 15 additions and 22 deletions

View File

@ -4,8 +4,8 @@ using UnityEngine;
namespace DCFApixels.DragonECS.Unity.Editors namespace DCFApixels.DragonECS.Unity.Editors
{ {
[FilePath(EcsConsts.FRAMEWORK_NAME + "/" + nameof(DebugMonitorPrefs) + ".prefs", FilePathAttribute.Location.ProjectFolder)] [FilePath(EcsConsts.FRAMEWORK_NAME + "/" + nameof(SettingsPrefs) + ".prefs", FilePathAttribute.Location.ProjectFolder)]
public class DebugMonitorPrefs : ScriptableSingleton<DebugMonitorPrefs> public class SettingsPrefs : ScriptableSingleton<SettingsPrefs>
{ {
[SerializeField] [SerializeField]
private bool _isShowInterfaces = false; private bool _isShowInterfaces = false;
@ -30,7 +30,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
} }
} }
[SerializeField] [SerializeField]
private bool _isShowRuntimeComponents = true; private bool _isShowRuntimeComponents = false;
public bool IsShowRuntimeComponents public bool IsShowRuntimeComponents
{ {
get => _isShowRuntimeComponents; get => _isShowRuntimeComponents;

View File

@ -22,13 +22,13 @@ namespace DCFApixels.DragonECS.Unity.Editors
private PipelineMonitor Target => (PipelineMonitor)target; private PipelineMonitor Target => (PipelineMonitor)target;
private bool IsShowInterfaces private bool IsShowInterfaces
{ {
get { return DebugMonitorPrefs.instance.IsShowInterfaces; } get { return SettingsPrefs.instance.IsShowInterfaces; }
set { DebugMonitorPrefs.instance.IsShowInterfaces = value; } set { SettingsPrefs.instance.IsShowInterfaces = value; }
} }
private bool IsShowHidden private bool IsShowHidden
{ {
get { return DebugMonitorPrefs.instance.IsShowHidden; } get { return SettingsPrefs.instance.IsShowHidden; }
set { DebugMonitorPrefs.instance.IsShowHidden = value; } set { SettingsPrefs.instance.IsShowHidden = value; }
} }
public override void OnInspectorGUI() public override void OnInspectorGUI()

View File

@ -23,13 +23,13 @@ namespace DCFApixels.DragonECS.Unity.Editors
private PipelineProcessMonitor Target => (PipelineProcessMonitor)target; private PipelineProcessMonitor Target => (PipelineProcessMonitor)target;
private bool IsShowInterfaces private bool IsShowInterfaces
{ {
get { return DebugMonitorPrefs.instance.IsShowInterfaces; } get { return SettingsPrefs.instance.IsShowInterfaces; }
set { DebugMonitorPrefs.instance.IsShowInterfaces = value; } set { SettingsPrefs.instance.IsShowInterfaces = value; }
} }
private bool IsShowHidden private bool IsShowHidden
{ {
get { return DebugMonitorPrefs.instance.IsShowHidden; } get { return SettingsPrefs.instance.IsShowHidden; }
set { DebugMonitorPrefs.instance.IsShowHidden = value; } set { SettingsPrefs.instance.IsShowHidden = value; }
} }
private void Init() private void Init()
@ -78,7 +78,6 @@ namespace DCFApixels.DragonECS.Unity.Editors
private Vector2 _cellsize = new Vector2(EditorGUIUtility.singleLineHeight, EditorGUIUtility.singleLineHeight); private Vector2 _cellsize = new Vector2(EditorGUIUtility.singleLineHeight, EditorGUIUtility.singleLineHeight);
private Vector2 _nameCellSize = new Vector2(200f, 200f); private Vector2 _nameCellSize = new Vector2(200f, 200f);
//private Vector2Int _selectedPoint = new Vector2Int(-1, -1);
private (TypeMeta system, TypeMeta process) _selectedPointMeta = default; private (TypeMeta system, TypeMeta process) _selectedPointMeta = default;
public override void OnInspectorGUI() public override void OnInspectorGUI()
{ {
@ -126,7 +125,6 @@ namespace DCFApixels.DragonECS.Unity.Editors
if (EcsGUI.HitTest(lineRect)) if (EcsGUI.HitTest(lineRect))
{ {
GUI.Button(lineRect, "", EditorStyles.selectionRect); GUI.Button(lineRect, "", EditorStyles.selectionRect);
//_selectedPoint.x = i;
_selectedPointMeta.process = meta; _selectedPointMeta.process = meta;
} }
GUIUtility.RotateAroundPivot(90, pivod); GUIUtility.RotateAroundPivot(90, pivod);
@ -158,7 +156,6 @@ namespace DCFApixels.DragonECS.Unity.Editors
if (EcsGUI.HitTest(lineRect)) if (EcsGUI.HitTest(lineRect))
{ {
GUI.Button(lineRect, "", EditorStyles.selectionRect); GUI.Button(lineRect, "", EditorStyles.selectionRect);
//_selectedPoint.y = i;
_selectedPointMeta.system = meta; _selectedPointMeta.system = meta;
} }
GUI.Label(rect, UnityEditorUtility.GetLabel(name, i + " " + name), EditorStyles.miniBoldLabel); GUI.Label(rect, UnityEditorUtility.GetLabel(name, i + " " + name), EditorStyles.miniBoldLabel);
@ -175,10 +172,6 @@ namespace DCFApixels.DragonECS.Unity.Editors
{ {
rect = new Rect(x * _cellsize.x + _nameCellSize.x, y * _cellsize.y + _nameCellSize.y, _cellsize.x, _cellsize.y); rect = new Rect(x * _cellsize.x + _nameCellSize.x, y * _cellsize.y + _nameCellSize.y, _cellsize.x, _cellsize.y);
bool flag = process.systemsBitMask[y]; bool flag = process.systemsBitMask[y];
//string tooltip = $"{process.meta.Name}-{_systemsList[x].meta.Name}";
//GUIContent label = flag ? UnityEditorUtility.GetLabel(checkIcon, tooltip) : UnityEditorUtility.GetLabel("", tooltip);
//GUI.Label(rect, label);
if (flag) if (flag)
{ {
GUI.Label(rect, UnityEditorUtility.GetLabel(checkIcon)); GUI.Label(rect, UnityEditorUtility.GetLabel(checkIcon));

View File

@ -48,13 +48,13 @@ namespace DCFApixels.DragonECS.Unity.Editors
private static bool IsShowHidden private static bool IsShowHidden
{ {
get { return DebugMonitorPrefs.instance.IsShowHidden; } get { return SettingsPrefs.instance.IsShowHidden; }
set { DebugMonitorPrefs.instance.IsShowHidden = value; } set { SettingsPrefs.instance.IsShowHidden = value; }
} }
private static bool IsShowRuntimeComponents private static bool IsShowRuntimeComponents
{ {
get { return DebugMonitorPrefs.instance.IsShowRuntimeComponents; } get { return SettingsPrefs.instance.IsShowRuntimeComponents; }
set { DebugMonitorPrefs.instance.IsShowRuntimeComponents = value; } set { SettingsPrefs.instance.IsShowRuntimeComponents = value; }
} }
public enum AddClearComponentButton : byte public enum AddClearComponentButton : byte