diff --git a/src/Debug/DebugService/UnityDebugService.cs b/src/Debug/DebugService/UnityDebugService.cs index 39c4543..cc992fa 100644 --- a/src/Debug/DebugService/UnityDebugService.cs +++ b/src/Debug/DebugService/UnityDebugService.cs @@ -2,7 +2,7 @@ using Unity.Profiling; using UnityEngine; -namespace DCFApixels.DragonECS.Unity +namespace DCFApixels.DragonECS { public class UnityDebugService : DebugService { diff --git a/src/Debug/Editor/EcsEditor.cs b/src/Debug/Editor/EcsEditor.cs index 5dbc09d..29d0325 100644 --- a/src/Debug/Editor/EcsEditor.cs +++ b/src/Debug/Editor/EcsEditor.cs @@ -1,10 +1,7 @@ #if UNITY_EDITOR -using System.Collections.Generic; -using System.Linq; using UnityEngine; -using UnityEditor; -namespace DCFApixels.DragonECS.Unity.Editors +namespace DCFApixels.DragonECS.Editors { public static class EcsEditor { diff --git a/src/Debug/Systems/DebugMonitorPrefs.cs b/src/Debug/Systems/DebugMonitorPrefs.cs index 6f74288..9bcc5c3 100644 --- a/src/Debug/Systems/DebugMonitorPrefs.cs +++ b/src/Debug/Systems/DebugMonitorPrefs.cs @@ -1,17 +1,31 @@ #if UNITY_EDITOR -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; using UnityEditor; -namespace DCFApixels.DragonECS.Unity +namespace DCFApixels.DragonECS.Editors { [FilePath("DragonECS/DebugMonitorPrefs.prefs", FilePathAttribute.Location.ProjectFolder)] public class DebugMonitorPrefs : ScriptableSingleton { - public bool isShowHidden = false; - public bool isShowInterfaces = false; + private bool _isShowHidden = false; + public bool _isShowInterfaces = false; + + public bool IsShowHidden + { + get => IsShowHidden1; set + { + IsShowHidden1 = value; + Save(false); + } + } + + public bool IsShowHidden1 + { + get => _isShowHidden; set + { + _isShowHidden = value; + Save(false); + } + } } } #endif diff --git a/src/Debug/Systems/SystemsDebugSystem.cs b/src/Debug/Systems/SystemsDebugSystem.cs index 5515081..d100ffb 100644 --- a/src/Debug/Systems/SystemsDebugSystem.cs +++ b/src/Debug/Systems/SystemsDebugSystem.cs @@ -1,10 +1,8 @@ -using System.Collections; -using System.Collections.Generic; +using System.Reflection; using UnityEngine; -using System.Reflection; -namespace DCFApixels.DragonECS.Unity +namespace DCFApixels.DragonECS { [DebugHide, DebugColor(DebugColor.Gray)] public class SystemsDebugSystem : IEcsPreInitSystem @@ -33,7 +31,6 @@ namespace DCFApixels.DragonECS.Unity } #if UNITY_EDITOR - namespace Editors { using System; @@ -66,8 +63,8 @@ namespace DCFApixels.DragonECS.Unity GUILayout.Label("[Systems]", _headerStyle); - DebugMonitorPrefs.instance.isShowInterfaces = EditorGUILayout.Toggle("Show Interfaces", DebugMonitorPrefs.instance.isShowInterfaces); - DebugMonitorPrefs.instance.isShowHidden = EditorGUILayout.Toggle("Show Hidden", DebugMonitorPrefs.instance.isShowHidden); + DebugMonitorPrefs.instance._isShowInterfaces = EditorGUILayout.Toggle("Show Interfaces", DebugMonitorPrefs.instance._isShowInterfaces); + DebugMonitorPrefs.instance.IsShowHidden = EditorGUILayout.Toggle("Show Hidden", DebugMonitorPrefs.instance.IsShowHidden); GUILayout.BeginVertical(); foreach (var item in Target.systems.AllSystems) @@ -110,16 +107,13 @@ namespace DCFApixels.DragonECS.Unity string name = type.Name; Color color = (GetAttribute(type) ?? _fakeDebugColorAttribute).GetUnityColor(); - //Color defaultBackgroundColor = GUI.backgroundColor; - //GUI.backgroundColor = color; GUILayout.BeginVertical(EcsEditor.GetStyle(color)); - if (DebugMonitorPrefs.instance.isShowInterfaces) + if (DebugMonitorPrefs.instance._isShowInterfaces) { GUILayout.Label(string.Join(", ", type.GetInterfaces().Select(o => o.Name)), _interfacesStyle); } GUILayout.Label(name, EditorStyles.boldLabel); GUILayout.EndVertical(); - //GUI.backgroundColor = defaultBackgroundColor; } private void DrawRunner(IEcsRunner runner) @@ -129,14 +123,10 @@ namespace DCFApixels.DragonECS.Unity return; Color color = (GetAttribute(type) ?? _fakeDebugColorAttribute).GetUnityColor(); - //Color defaultBackgroundColor = GUI.backgroundColor; - //GUI.backgroundColor = color; GUILayout.BeginVertical(EcsEditor.GetStyle(color)); - //GUILayout.BeginVertical(EditorStyles.helpBox); GUILayout.Label(type.Name, EditorStyles.boldLabel); GUILayout.Label(string.Join(", ", runner.Targets.Cast().Select(o => o.GetType().Name))); GUILayout.EndVertical(); - //GUI.backgroundColor = defaultBackgroundColor; } private TAttribute GetAttribute(Type target) where TAttribute : Attribute @@ -149,7 +139,7 @@ namespace DCFApixels.DragonECS.Unity private bool CheckIsHidden(Type target) { - if (DebugMonitorPrefs.instance.isShowHidden) + if (DebugMonitorPrefs.instance.IsShowHidden) return false; return target.GetCustomAttribute() != null; diff --git a/src/Debug/Systems/WorldDebugSystem.cs b/src/Debug/Systems/WorldDebugSystem.cs index 70f57ad..327a93f 100644 --- a/src/Debug/Systems/WorldDebugSystem.cs +++ b/src/Debug/Systems/WorldDebugSystem.cs @@ -2,7 +2,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -namespace DCFApixels.DragonECS.Unity +namespace DCFApixels.DragonECS { public class WorldDebugSystem : IEcsRunSystem { diff --git a/src/GameObjectRef.cs b/src/GameObjectRef.cs index 4820bd5..b337baa 100644 --- a/src/GameObjectRef.cs +++ b/src/GameObjectRef.cs @@ -4,7 +4,7 @@ using UnityEngine; using UnityEditor; #endif -namespace DCFApixels.DragonECS.Unity +namespace DCFApixels.DragonECS { public struct GameObjectRef { diff --git a/src/Runner/IEcsFixedRunSystem.cs b/src/Runner/IEcsFixedRunSystem.cs index 0b077fa..7525a66 100644 --- a/src/Runner/IEcsFixedRunSystem.cs +++ b/src/Runner/IEcsFixedRunSystem.cs @@ -1,4 +1,4 @@ -namespace DCFApixels.DragonECS.Unity +namespace DCFApixels.DragonECS { public interface IEcsFixedRunSystem : IEcsSystem { diff --git a/src/Runner/IEcsLateRunSystem.cs b/src/Runner/IEcsLateRunSystem.cs index f8a4525..582316d 100644 --- a/src/Runner/IEcsLateRunSystem.cs +++ b/src/Runner/IEcsLateRunSystem.cs @@ -1,4 +1,4 @@ -namespace DCFApixels.DragonECS.Unity +namespace DCFApixels.DragonECS { public interface IEcsLateRunSystem : IEcsSystem { diff --git a/src/Utils/DebugColorAttributeExt.cs b/src/Utils/DebugColorAttributeExt.cs index 21f8526..c9d8ad5 100644 --- a/src/Utils/DebugColorAttributeExt.cs +++ b/src/Utils/DebugColorAttributeExt.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace DCFApixels.DragonECS.Unity +namespace DCFApixels.DragonECS { public static class DebugColorAttributeExt {