change namespace

This commit is contained in:
Mikhail 2023-03-29 19:58:58 +08:00
parent a3e2bb0407
commit e34b2a8f0d
9 changed files with 34 additions and 33 deletions

View File

@ -2,7 +2,7 @@
using Unity.Profiling; using Unity.Profiling;
using UnityEngine; using UnityEngine;
namespace DCFApixels.DragonECS.Unity namespace DCFApixels.DragonECS
{ {
public class UnityDebugService : DebugService public class UnityDebugService : DebugService
{ {

View File

@ -1,10 +1,7 @@
#if UNITY_EDITOR #if UNITY_EDITOR
using System.Collections.Generic;
using System.Linq;
using UnityEngine; using UnityEngine;
using UnityEditor;
namespace DCFApixels.DragonECS.Unity.Editors namespace DCFApixels.DragonECS.Editors
{ {
public static class EcsEditor public static class EcsEditor
{ {

View File

@ -1,17 +1,31 @@
#if UNITY_EDITOR #if UNITY_EDITOR
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor; using UnityEditor;
namespace DCFApixels.DragonECS.Unity namespace DCFApixels.DragonECS.Editors
{ {
[FilePath("DragonECS/DebugMonitorPrefs.prefs", FilePathAttribute.Location.ProjectFolder)] [FilePath("DragonECS/DebugMonitorPrefs.prefs", FilePathAttribute.Location.ProjectFolder)]
public class DebugMonitorPrefs : ScriptableSingleton<DebugMonitorPrefs> public class DebugMonitorPrefs : ScriptableSingleton<DebugMonitorPrefs>
{ {
public bool isShowHidden = false; private bool _isShowHidden = false;
public bool isShowInterfaces = 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 #endif

View File

@ -1,10 +1,8 @@
using System.Collections; using System.Reflection;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using System.Reflection;
namespace DCFApixels.DragonECS.Unity namespace DCFApixels.DragonECS
{ {
[DebugHide, DebugColor(DebugColor.Gray)] [DebugHide, DebugColor(DebugColor.Gray)]
public class SystemsDebugSystem : IEcsPreInitSystem public class SystemsDebugSystem : IEcsPreInitSystem
@ -33,7 +31,6 @@ namespace DCFApixels.DragonECS.Unity
} }
#if UNITY_EDITOR #if UNITY_EDITOR
namespace Editors namespace Editors
{ {
using System; using System;
@ -66,8 +63,8 @@ namespace DCFApixels.DragonECS.Unity
GUILayout.Label("[Systems]", _headerStyle); GUILayout.Label("[Systems]", _headerStyle);
DebugMonitorPrefs.instance.isShowInterfaces = EditorGUILayout.Toggle("Show Interfaces", DebugMonitorPrefs.instance.isShowInterfaces); DebugMonitorPrefs.instance._isShowInterfaces = EditorGUILayout.Toggle("Show Interfaces", DebugMonitorPrefs.instance._isShowInterfaces);
DebugMonitorPrefs.instance.isShowHidden = EditorGUILayout.Toggle("Show Hidden", DebugMonitorPrefs.instance.isShowHidden); DebugMonitorPrefs.instance.IsShowHidden = EditorGUILayout.Toggle("Show Hidden", DebugMonitorPrefs.instance.IsShowHidden);
GUILayout.BeginVertical(); GUILayout.BeginVertical();
foreach (var item in Target.systems.AllSystems) foreach (var item in Target.systems.AllSystems)
@ -110,16 +107,13 @@ namespace DCFApixels.DragonECS.Unity
string name = type.Name; string name = type.Name;
Color color = (GetAttribute<DebugColorAttribute>(type) ?? _fakeDebugColorAttribute).GetUnityColor(); Color color = (GetAttribute<DebugColorAttribute>(type) ?? _fakeDebugColorAttribute).GetUnityColor();
//Color defaultBackgroundColor = GUI.backgroundColor;
//GUI.backgroundColor = color;
GUILayout.BeginVertical(EcsEditor.GetStyle(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(string.Join(", ", type.GetInterfaces().Select(o => o.Name)), _interfacesStyle);
} }
GUILayout.Label(name, EditorStyles.boldLabel); GUILayout.Label(name, EditorStyles.boldLabel);
GUILayout.EndVertical(); GUILayout.EndVertical();
//GUI.backgroundColor = defaultBackgroundColor;
} }
private void DrawRunner(IEcsRunner runner) private void DrawRunner(IEcsRunner runner)
@ -129,14 +123,10 @@ namespace DCFApixels.DragonECS.Unity
return; return;
Color color = (GetAttribute<DebugColorAttribute>(type) ?? _fakeDebugColorAttribute).GetUnityColor(); Color color = (GetAttribute<DebugColorAttribute>(type) ?? _fakeDebugColorAttribute).GetUnityColor();
//Color defaultBackgroundColor = GUI.backgroundColor;
//GUI.backgroundColor = color;
GUILayout.BeginVertical(EcsEditor.GetStyle(color)); GUILayout.BeginVertical(EcsEditor.GetStyle(color));
//GUILayout.BeginVertical(EditorStyles.helpBox);
GUILayout.Label(type.Name, EditorStyles.boldLabel); GUILayout.Label(type.Name, EditorStyles.boldLabel);
GUILayout.Label(string.Join(", ", runner.Targets.Cast<object>().Select(o => o.GetType().Name))); GUILayout.Label(string.Join(", ", runner.Targets.Cast<object>().Select(o => o.GetType().Name)));
GUILayout.EndVertical(); GUILayout.EndVertical();
//GUI.backgroundColor = defaultBackgroundColor;
} }
private TAttribute GetAttribute<TAttribute>(Type target) where TAttribute : Attribute private TAttribute GetAttribute<TAttribute>(Type target) where TAttribute : Attribute
@ -149,7 +139,7 @@ namespace DCFApixels.DragonECS.Unity
private bool CheckIsHidden(Type target) private bool CheckIsHidden(Type target)
{ {
if (DebugMonitorPrefs.instance.isShowHidden) if (DebugMonitorPrefs.instance.IsShowHidden)
return false; return false;
return target.GetCustomAttribute<DebugHideAttribute>() != null; return target.GetCustomAttribute<DebugHideAttribute>() != null;

View File

@ -2,7 +2,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
namespace DCFApixels.DragonECS.Unity namespace DCFApixels.DragonECS
{ {
public class WorldDebugSystem : IEcsRunSystem public class WorldDebugSystem : IEcsRunSystem
{ {

View File

@ -4,7 +4,7 @@ using UnityEngine;
using UnityEditor; using UnityEditor;
#endif #endif
namespace DCFApixels.DragonECS.Unity namespace DCFApixels.DragonECS
{ {
public struct GameObjectRef public struct GameObjectRef
{ {

View File

@ -1,4 +1,4 @@
namespace DCFApixels.DragonECS.Unity namespace DCFApixels.DragonECS
{ {
public interface IEcsFixedRunSystem : IEcsSystem public interface IEcsFixedRunSystem : IEcsSystem
{ {

View File

@ -1,4 +1,4 @@
namespace DCFApixels.DragonECS.Unity namespace DCFApixels.DragonECS
{ {
public interface IEcsLateRunSystem : IEcsSystem public interface IEcsLateRunSystem : IEcsSystem
{ {

View File

@ -1,6 +1,6 @@
using UnityEngine; using UnityEngine;
namespace DCFApixels.DragonECS.Unity namespace DCFApixels.DragonECS
{ {
public static class DebugColorAttributeExt public static class DebugColorAttributeExt
{ {