diff --git a/src/Connectors/EcsPipelineProvider.cs b/src/Connectors/EcsPipelineProvider.cs index 8d7378a..df06c57 100644 --- a/src/Connectors/EcsPipelineProvider.cs +++ b/src/Connectors/EcsPipelineProvider.cs @@ -10,7 +10,7 @@ namespace DCFApixels.DragonECS { private EcsPipeline _pipeline; private static EcsPipelineProvider _singletonInstance; - + #region Properties public bool IsEmpty { @@ -20,7 +20,7 @@ namespace DCFApixels.DragonECS { get { - if(_singletonInstance == null) + if (_singletonInstance == null) { _singletonInstance = FindOrCreateSingleton(); } diff --git a/src/Connectors/Editor/EcsWorldProviderBaseEditor.cs b/src/Connectors/Editor/EcsWorldProviderBaseEditor.cs index 8d61c90..b10c1a0 100644 --- a/src/Connectors/Editor/EcsWorldProviderBaseEditor.cs +++ b/src/Connectors/Editor/EcsWorldProviderBaseEditor.cs @@ -10,27 +10,41 @@ namespace DCFApixels.DragonECS.Unity.Editors { private EcsWorldProviderBase Target => (EcsWorldProviderBase)target; + private static Color _emptyColor = new Color32(255, 0, 75, 100); + private static Color _destroyedColor = new Color32(255, 75, 0, 100); + private static Color _aliveColor = new Color32(75, 255, 0, 100); + public override void OnInspectorGUI() { EcsWorld world = Target.GetCurrentWorldRaw(); + + Color labelBackColor; + string labelText; + if (world == null) { - var style = UnityEditorUtility.GetStyle(new Color32(255, 0, 75, 100)); - GUILayout.Box("Is Empty", style, GUILayout.ExpandWidth(true)); + labelBackColor = _emptyColor; + labelText = "Is Empty"; } else { if (world.IsDestroyed) { - var style = UnityEditorUtility.GetStyle(new Color32(255, 75, 0, 100)); - GUILayout.Box($"{world.GetMeta().Name} ( {world.ID} ) Destroyed", style, GUILayout.ExpandWidth(true)); + labelBackColor = _destroyedColor; + labelText = $"{world.GetMeta().Name} ( {world.ID} ) Destroyed"; } else { - var style = UnityEditorUtility.GetStyle(new Color32(75, 255, 0, 100)); - GUILayout.Box($"{world.GetMeta().Name} ( {world.ID} )", style, GUILayout.ExpandWidth(true)); + labelBackColor = _aliveColor; + labelText = $"{world.GetMeta().Name} ( {world.ID} )"; } } + + using (EcsGUI.SetBackgroundColor(labelBackColor)) + { + GUILayout.Box("Is Empty", UnityEditorUtility.GetWhiteStyle(), GUILayout.ExpandWidth(true)); + } + EcsGUI.Layout.DrawWorldBaseInfo(Target.GetCurrentWorldRaw()); base.OnInspectorGUI(); diff --git a/src/DebugUtils/Monitors/Editor/EntityMonitorEditor.cs b/src/DebugUtils/Monitors/Editor/EntityMonitorEditor.cs index 0b40c0b..d0c3c4b 100644 --- a/src/DebugUtils/Monitors/Editor/EntityMonitorEditor.cs +++ b/src/DebugUtils/Monitors/Editor/EntityMonitorEditor.cs @@ -24,7 +24,7 @@ namespace DCFApixels.DragonECS.Unity.Editors var drawers = UnityEditorUtility._entityEditorBlockDrawers; if (drawers.Length > 0) { - using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetStyle(Color.black, 0.2f))) + using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetTransperentBlackBackgrounStyle())) { bool isExpand = false; using (EcsGUI.CheckChanged()) @@ -44,9 +44,9 @@ namespace DCFApixels.DragonECS.Unity.Editors } } } - + } - + EcsGUI.Layout.DrawRuntimeComponents(entity, false); } } diff --git a/src/DebugUtils/Monitors/Editor/PipelineMonitorEditor.cs b/src/DebugUtils/Monitors/Editor/PipelineMonitorEditor.cs index 3fef48a..909eb3e 100644 --- a/src/DebugUtils/Monitors/Editor/PipelineMonitorEditor.cs +++ b/src/DebugUtils/Monitors/Editor/PipelineMonitorEditor.cs @@ -95,7 +95,7 @@ namespace DCFApixels.DragonECS.Unity.Editors GUILayout.Label("[Runners]", _headerStyle); - using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetStyle(Color.black, 0.2f))) + using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetTransperentBlackBackgrounStyle())) { int i = 0; foreach (var item in Target.Pipeline.AllRunners) @@ -112,7 +112,7 @@ namespace DCFApixels.DragonECS.Unity.Editors if (system is SystemsLayerMarkerSystem markerSystem) { GUILayout.EndVertical(); - GUILayout.BeginVertical(UnityEditorUtility.GetStyle(Color.black, 0.2f)); + GUILayout.BeginVertical(UnityEditorUtility.GetTransperentBlackBackgrounStyle()); using (EcsGUI.Layout.BeginHorizontal()) using (var scope = EcsGUI.SetAlignment(GUI.skin.label)) { @@ -150,7 +150,7 @@ namespace DCFApixels.DragonECS.Unity.Editors Color color = EcsGUI.SelectPanelColor(meta, index, -1); - using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetStyle(color, 0.2f))) + using (EcsGUI.Layout.BeginVertical(color.SetAlpha(0.2f))) { if (IsShowInterfaces) { @@ -170,7 +170,7 @@ namespace DCFApixels.DragonECS.Unity.Editors } Color color = EcsGUI.SelectPanelColor(meta, index, -1); - using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetStyle(color, 0.2f))) + using (EcsGUI.Layout.BeginVertical(color.SetAlpha(0.2f))) { GUILayout.Label(meta.Name, EditorStyles.boldLabel); GUILayout.Label(string.Join(", ", runner.ProcessRaw.Cast().Select(o => o.GetType().Name)), systemsListStyle); diff --git a/src/DebugUtils/Monitors/Editor/WorldQueriesMonitorEditor.cs b/src/DebugUtils/Monitors/Editor/WorldQueriesMonitorEditor.cs index 04ba3bf..116fba8 100644 --- a/src/DebugUtils/Monitors/Editor/WorldQueriesMonitorEditor.cs +++ b/src/DebugUtils/Monitors/Editor/WorldQueriesMonitorEditor.cs @@ -146,7 +146,7 @@ namespace DCFApixels.DragonECS.Unity.Editors //GUILayout.Space(10f); //using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetStyle(GetGenericPanelColor(index)))) - using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetStyle(Color.black, 0.2f))) + using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetTransperentBlackBackgrounStyle())) { var mask = executor.Mask; DrawConstraint("+", mask.Incs); @@ -189,7 +189,7 @@ namespace DCFApixels.DragonECS.Unity.Editors Color color = EcsGUI.SelectPanelColor(meta, i, 9); - using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetStyle(color, 0.2f))) + using (EcsGUI.Layout.BeginVertical(color.SetAlpha(0.2f))) { GUILayout.Label(meta.TypeName); } diff --git a/src/Internal/Editor/EcsGUI.Layout.cs b/src/Internal/Editor/EcsGUI.Layout.cs index 1bfa5b9..a220d72 100644 --- a/src/Internal/Editor/EcsGUI.Layout.cs +++ b/src/Internal/Editor/EcsGUI.Layout.cs @@ -91,7 +91,7 @@ namespace DCFApixels.DragonECS.Unity.Editors { bool isNull = world == null || world.IsDestroyed || world.ID == 0; if (isNull) { return; } - using (BeginVertical(UnityEditorUtility.GetStyle(Color.black, 0.2f))) + using (BeginVertical(UnityEditorUtility.GetTransperentBlackBackgrounStyle())) { IsShowRuntimeComponents = EditorGUILayout.BeginFoldoutHeaderGroup(IsShowRuntimeComponents, "RUNTIME COMPONENTS", EditorStyles.foldout); EditorGUILayout.EndFoldoutHeaderGroup(); @@ -127,37 +127,38 @@ namespace DCFApixels.DragonECS.Unity.Editors } Color panelColor = SelectPanelColor(meta, index, total); - GUILayout.BeginVertical(UnityEditorUtility.GetStyle(panelColor, EscEditorConsts.COMPONENT_DRAWER_ALPHA)); - EditorGUI.BeginChangeCheck(); - - ////Close button - //optionButton.xMin = optionButton.xMax - HeadIconsRect.width; - //if (CloseButton(optionButton)) - //{ - // cmp.Del(worldID); - // return; - //} - - //Edit script button - if (ScriptsCache.TryGetScriptAsset(meta, out MonoScript script)) + using (BeginVertical(panelColor.SetAlpha(EscEditorConsts.COMPONENT_DRAWER_ALPHA))) { - optionButton = HeadIconsRect.MoveTo(optionButton.center - (Vector2.right * optionButton.width)); - EcsGUI.ScriptAssetButton(optionButton, script); - } - //Description icon - if (string.IsNullOrEmpty(meta.Description.Text) == false) - { - optionButton = HeadIconsRect.MoveTo(optionButton.center - (Vector2.right * optionButton.width)); - DescriptionIcon(optionButton, meta.Description.Text); - } + EditorGUI.BeginChangeCheck(); - RuntimeComponentReflectionCache.FieldInfoData componentInfoData = new RuntimeComponentReflectionCache.FieldInfoData(null, componentType, meta.Name); - if (DrawRuntimeData(ref componentInfoData, UnityEditorUtility.GetLabel(meta.Name), expandMatrix, data, out object resultData)) - { - cmp.SetRaw(worldID, resultData); - } + ////Close button + //optionButton.xMin = optionButton.xMax - HeadIconsRect.width; + //if (CloseButton(optionButton)) + //{ + // cmp.Del(worldID); + // return; + //} - GUILayout.EndVertical(); + //Edit script button + if (ScriptsCache.TryGetScriptAsset(meta, out MonoScript script)) + { + optionButton = HeadIconsRect.MoveTo(optionButton.center - (Vector2.right * optionButton.width)); + EcsGUI.ScriptAssetButton(optionButton, script); + } + //Description icon + if (string.IsNullOrEmpty(meta.Description.Text) == false) + { + optionButton = HeadIconsRect.MoveTo(optionButton.center - (Vector2.right * optionButton.width)); + DescriptionIcon(optionButton, meta.Description.Text); + } + + RuntimeComponentReflectionCache.FieldInfoData componentInfoData = new RuntimeComponentReflectionCache.FieldInfoData(null, componentType, meta.Name); + if (DrawRuntimeData(ref componentInfoData, UnityEditorUtility.GetLabel(meta.Name), expandMatrix, data, out object resultData)) + { + cmp.SetRaw(worldID, resultData); + } + + } } } } @@ -214,7 +215,7 @@ namespace DCFApixels.DragonECS.Unity.Editors private static List _componentPoolsBuffer; public static void DrawRuntimeComponents(int entityID, EcsWorld world, bool isWithFoldout = true) { - using (BeginVertical(UnityEditorUtility.GetStyle(Color.black, 0.2f))) + using (BeginVertical(UnityEditorUtility.GetTransperentBlackBackgrounStyle())) { if (isWithFoldout) { @@ -270,38 +271,38 @@ namespace DCFApixels.DragonECS.Unity.Editors } Color panelColor = SelectPanelColor(meta, index, total); - GUILayout.BeginVertical(UnityEditorUtility.GetStyle(panelColor, EscEditorConsts.COMPONENT_DRAWER_ALPHA)); - EditorGUI.BeginChangeCheck(); - //Close button - optionButton.xMin = optionButton.xMax - HeadIconsRect.width; - if (CloseButton(optionButton)) + using (BeginVertical(panelColor.SetAlpha(EscEditorConsts.COMPONENT_DRAWER_ALPHA))) { - pool.Del(entityID); - return; - } - //Edit script button - if (ScriptsCache.TryGetScriptAsset(meta, out MonoScript script)) - { - optionButton = HeadIconsRect.MoveTo(optionButton.center - (Vector2.right * optionButton.width)); - EcsGUI.ScriptAssetButton(optionButton, script); - } - //Description icon - if (string.IsNullOrEmpty(meta.Description.Text) == false) - { - optionButton = HeadIconsRect.MoveTo(optionButton.center - (Vector2.right * optionButton.width)); - DescriptionIcon(optionButton, meta.Description.Text); - } + EditorGUI.BeginChangeCheck(); - RuntimeComponentReflectionCache.FieldInfoData componentInfoData = new RuntimeComponentReflectionCache.FieldInfoData(null, componentType, meta.Name); + //Close button + optionButton.xMin = optionButton.xMax - HeadIconsRect.width; + if (CloseButton(optionButton)) + { + pool.Del(entityID); + return; + } + //Edit script button + if (ScriptsCache.TryGetScriptAsset(meta, out MonoScript script)) + { + optionButton = HeadIconsRect.MoveTo(optionButton.center - (Vector2.right * optionButton.width)); + EcsGUI.ScriptAssetButton(optionButton, script); + } + //Description icon + if (string.IsNullOrEmpty(meta.Description.Text) == false) + { + optionButton = HeadIconsRect.MoveTo(optionButton.center - (Vector2.right * optionButton.width)); + DescriptionIcon(optionButton, meta.Description.Text); + } - if (DrawRuntimeData(ref componentInfoData, UnityEditorUtility.GetLabel(meta.Name), expandMatrix, data, out object resultData)) - { - pool.SetRaw(entityID, resultData); + RuntimeComponentReflectionCache.FieldInfoData componentInfoData = new RuntimeComponentReflectionCache.FieldInfoData(null, componentType, meta.Name); + + if (DrawRuntimeData(ref componentInfoData, UnityEditorUtility.GetLabel(meta.Name), expandMatrix, data, out object resultData)) + { + pool.SetRaw(entityID, resultData); + } } - - - GUILayout.EndVertical(); } } diff --git a/src/Internal/Editor/EcsGUI.cs b/src/Internal/Editor/EcsGUI.cs index 3a33023..c4f6cbd 100644 --- a/src/Internal/Editor/EcsGUI.cs +++ b/src/Internal/Editor/EcsGUI.cs @@ -205,12 +205,26 @@ namespace DCFApixels.DragonECS.Unity.Editors { public VerticalScope(GUILayoutOption[] options) { GUILayout.BeginVertical(options); } public VerticalScope(GUIStyle style, GUILayoutOption[] options) { GUILayout.BeginVertical(style, options); } + public VerticalScope(Color backgroundColor, GUILayoutOption[] options) + { + using (SetColor(backgroundColor)) + { + GUILayout.BeginVertical(UnityEditorUtility.GetWhiteStyle(), options); + } + } public void Dispose() { GUILayout.EndVertical(); } } public struct HorizontalScope : IDisposable { public HorizontalScope(GUILayoutOption[] options) { GUILayout.BeginHorizontal(options); } public HorizontalScope(GUIStyle style, GUILayoutOption[] options) { GUILayout.BeginHorizontal(style, options); } + public HorizontalScope(Color backgroundColor, GUILayoutOption[] options) + { + using (SetColor(backgroundColor)) + { + GUILayout.BeginHorizontal(UnityEditorUtility.GetWhiteStyle(), options); + } + } public void Dispose() { GUILayout.EndHorizontal(); } } public struct ScrollViewScope : IDisposable @@ -221,14 +235,16 @@ namespace DCFApixels.DragonECS.Unity.Editors } public static ScrollViewScope BeginScrollView(ref Vector2 pos) => new ScrollViewScope(ref pos, Array.Empty()); - public static HorizontalScope BeginHorizontal() => new HorizontalScope(Array.Empty()); - public static VerticalScope BeginVertical() => new VerticalScope(Array.Empty()); public static ScrollViewScope BeginScrollView(ref Vector2 pos, params GUILayoutOption[] options) => new ScrollViewScope(ref pos, options); - public static HorizontalScope BeginHorizontal(params GUILayoutOption[] options) => new HorizontalScope(options); - public static VerticalScope BeginVertical(params GUILayoutOption[] options) => new VerticalScope(options); public static ScrollViewScope BeginScrollView(ref Vector2 pos, GUIStyle style, params GUILayoutOption[] options) => new ScrollViewScope(ref pos, style, options); + public static HorizontalScope BeginHorizontal() => new HorizontalScope(Array.Empty()); + public static HorizontalScope BeginHorizontal(params GUILayoutOption[] options) => new HorizontalScope(options); public static HorizontalScope BeginHorizontal(GUIStyle style, params GUILayoutOption[] options) => new HorizontalScope(style, options); + public static HorizontalScope BeginHorizontal(Color backgroundColor, params GUILayoutOption[] options) => new HorizontalScope(backgroundColor, options); + public static VerticalScope BeginVertical() => new VerticalScope(Array.Empty()); + public static VerticalScope BeginVertical(params GUILayoutOption[] options) => new VerticalScope(options); public static VerticalScope BeginVertical(GUIStyle style, params GUILayoutOption[] options) => new VerticalScope(style, options); + public static VerticalScope BeginVertical(Color backgroundColor, params GUILayoutOption[] options) => new VerticalScope(backgroundColor, options); } public static CheckChangedScope CheckChanged() => CheckChangedScope.New(); public static CheckChangedScopeWithAutoApply CheckChanged(SerializedObject serializedObject) => new CheckChangedScopeWithAutoApply(serializedObject); @@ -1022,7 +1038,7 @@ namespace DCFApixels.DragonECS.Unity.Editors GetReferenceDropDown(sortedPredicateTypes, sortedWithOutTypes).Show(position); } -#endregion + #endregion } } #endif \ No newline at end of file diff --git a/src/Internal/Editor/UnityEditorUtility.cs b/src/Internal/Editor/UnityEditorUtility.cs index 727d0b9..435cad3 100644 --- a/src/Internal/Editor/UnityEditorUtility.cs +++ b/src/Internal/Editor/UnityEditorUtility.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Runtime.InteropServices; using System.Text; using UnityEngine; using UnityObject = UnityEngine.Object; @@ -125,7 +124,7 @@ namespace DCFApixels.DragonECS.Unity.Editors foreach (var type in assembly.GetTypes()) { - if ((type.IsGenericType || type.IsAbstract || type.IsInterface) == false && + if ((type.IsGenericType || type.IsAbstract || type.IsInterface) == false && typeof(EntityEditorBlockDrawer).IsAssignableFrom(type)) { var drawer = (EntityEditorBlockDrawer)Activator.CreateInstance(type); @@ -368,6 +367,36 @@ namespace DCFApixels.DragonECS.Unity.Editors } #endregion + #region WhiteTexture + private static Texture2D _whiteTexture; + private static GUIStyle _whiteStyle; + private static GUIStyle _transperentBlackBackgrounStyle; + public static Texture2D GetWhiteTexture() + { + if (_whiteTexture == null) + { + _whiteTexture = CreateTexture(2, 2, Color.white); + } + return _whiteTexture; + } + public static GUIStyle GetWhiteStyle() + { + if (_whiteStyle == null || _whiteStyle.normal.background == null) + { + _whiteStyle = CreateStyle(GetWhiteTexture(), GUI.skin.label); + } + return _whiteStyle; + } + public static GUIStyle GetTransperentBlackBackgrounStyle() + { + if (_transperentBlackBackgrounStyle == null || _transperentBlackBackgrounStyle.normal.background == null) + { + _transperentBlackBackgrounStyle = CreateStyle(CreateTexture(2, 2, new Color(0, 0, 0, 0.2f)), GUI.skin.label); + } + return _transperentBlackBackgrounStyle; + } + #endregion + #region GetStyle public static GUIStyle GetStyle(Color color, float alphaMultiplier) { @@ -376,26 +405,29 @@ namespace DCFApixels.DragonECS.Unity.Editors } public static GUIStyle GetStyle(Color32 color32) { - int colorCode = new Color32Union(color32).colorCode; + int colorCode = color32.GetCode32(); if (colorBoxeStyles.TryGetValue(colorCode, out GUIStyle style)) { if (style == null || style.normal.background == null) { - style = CreateStyle(color32, colorCode); + style = CreateStyle(CreateTexture(2, 2, color32)); colorBoxeStyles[colorCode] = style; } return style; } - style = CreateStyle(color32, colorCode); + style = CreateStyle(CreateTexture(2, 2, color32)); colorBoxeStyles.Add(colorCode, style); return style; } - private static GUIStyle CreateStyle(Color32 color32, int colorCode) + private static GUIStyle CreateStyle(Texture2D texture, GUIStyle referenceStyle = null) { + if (referenceStyle == null) + { + referenceStyle = GUI.skin.box; + } GUIStyle result = new GUIStyle(GUI.skin.box); - Color componentColor = color32; - Texture2D texture2D = CreateTexture(2, 2, componentColor); + Texture2D texture2D = texture; result.hover.background = texture2D; result.hover.scaledBackgrounds = Array.Empty(); result.focused.background = texture2D; @@ -410,45 +442,15 @@ namespace DCFApixels.DragonECS.Unity.Editors { var pixels = new Color[width * height]; for (var i = 0; i < pixels.Length; ++i) + { pixels[i] = color; - + } var result = new Texture2D(width, height); result.SetPixels(pixels); result.Apply(); return result; } #endregion - - #region Utils - [StructLayout(LayoutKind.Explicit, Pack = 1, Size = 4)] - private readonly ref struct Color32Union - { - [FieldOffset(0)] - public readonly int colorCode; - [FieldOffset(0)] - public readonly byte r; - [FieldOffset(1)] - public readonly byte g; - [FieldOffset(2)] - public readonly byte b; - [FieldOffset(3)] - public readonly byte a; - public Color32Union(byte r, byte g, byte b, byte a) : this() - { - this.r = r; - this.g = g; - this.b = b; - this.a = a; - } - public Color32Union(Color32 color) : this() - { - r = color.r; - g = color.g; - b = color.b; - a = color.a; - } - } - #endregion } internal static class RuntimeComponentsUtility diff --git a/src/Internal/Utils/ColorUtility.cs b/src/Internal/Utils/ColorUtility.cs index fd6eb62..69a8989 100644 --- a/src/Internal/Utils/ColorUtility.cs +++ b/src/Internal/Utils/ColorUtility.cs @@ -21,5 +21,10 @@ namespace DCFApixels.DragonECS.Unity.Internal self.a = a; return self; } + + public unsafe static int GetCode32(this Color32 self) + { + return *(int*)&self; + } } } \ No newline at end of file diff --git a/src/Templates/EcsPipelineTemplate/Editor/PipelineTemplateEditor.cs b/src/Templates/EcsPipelineTemplate/Editor/PipelineTemplateEditor.cs index 60bfabf..9aea2bc 100644 --- a/src/Templates/EcsPipelineTemplate/Editor/PipelineTemplateEditor.cs +++ b/src/Templates/EcsPipelineTemplate/Editor/PipelineTemplateEditor.cs @@ -178,7 +178,7 @@ namespace DCFApixels.DragonECS.Unity.Editors private void DrawRecordList(SerializedProperty recordsProp) { GUILayout.Label(UnityEditorUtility.GetLabel(recordsProp.displayName), EditorStyles.boldLabel); - using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetStyle(Color.black, 0.2f))) + using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetTransperentBlackBackgrounStyle())) { GUILayout.Space(4f); diff --git a/src/Templates/EntityTemplate/Editor/EntityTemplateEditor.cs b/src/Templates/EntityTemplate/Editor/EntityTemplateEditor.cs index 96e2f52..e6aa0d2 100644 --- a/src/Templates/EntityTemplate/Editor/EntityTemplateEditor.cs +++ b/src/Templates/EntityTemplate/Editor/EntityTemplateEditor.cs @@ -1,9 +1,7 @@ #if UNITY_EDITOR using DCFApixels.DragonECS.Unity.Internal; using DCFApixels.DragonECS.Unity.RefRepairer.Editors; -using System; using UnityEditor; -using UnityEditor.Graphs; using UnityEditorInternal; using UnityEngine; @@ -179,7 +177,7 @@ namespace DCFApixels.DragonECS.Unity.Editors } } - using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetStyle(Color.black, 0.2f))) + using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetTransperentBlackBackgrounStyle())) { DrawTop(Target, _componentsProp); _reorderableComponentsList.DoLayoutList(); diff --git a/src/Tools/DragonDocs/Editors/DragonDocsPrefs.cs b/src/Tools/DragonDocs/Editors/DragonDocsPrefs.cs index 729a6d3..9e23cf1 100644 --- a/src/Tools/DragonDocs/Editors/DragonDocsPrefs.cs +++ b/src/Tools/DragonDocs/Editors/DragonDocsPrefs.cs @@ -73,7 +73,7 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors private void AddInfo(List infos, string path, int startIndex, int length) { MetaGroupInfo lastInfo; - if (infos.Count == 0) + if (infos.Count == 0) { lastInfo = new MetaGroupInfo(string.Empty, string.Empty, 0, 0, 0); } diff --git a/src/Tools/DragonDocs/Editors/DragonDocsWindow.cs b/src/Tools/DragonDocs/Editors/DragonDocsWindow.cs index 394d288..d812074 100644 --- a/src/Tools/DragonDocs/Editors/DragonDocsWindow.cs +++ b/src/Tools/DragonDocs/Editors/DragonDocsWindow.cs @@ -94,7 +94,7 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors GUILayout.Space(EditorGUIUtility.standardVerticalSpacing * -2f); - DataScrolPosition = GUILayout.BeginScrollView(DataScrolPosition, UnityEditorUtility.GetStyle(Color.black, 0.2f), GUILayout.ExpandWidth(true)); + DataScrolPosition = GUILayout.BeginScrollView(DataScrolPosition, UnityEditorUtility.GetTransperentBlackBackgrounStyle(), GUILayout.ExpandWidth(true)); DrawSelectedGroupMeta(selectedGroupInfo); GUILayout.EndScrollView(); @@ -251,7 +251,7 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors Color alphaPanelColor = panelColor; alphaPanelColor.a = EscEditorConsts.COMPONENT_DRAWER_ALPHA; - using (EcsGUI.Layout.BeginVertical(UnityEditorUtility.GetStyle(alphaPanelColor))) + using (EcsGUI.Layout.BeginVertical(alphaPanelColor)) { GUILayout.Space(1f);