From ce8052f8ce008528451bba31b40e27f80557cd17 Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Wed, 15 May 2024 00:36:56 +0800 Subject: [PATCH] update template inspector --- src/Debug/Editor/SettingsEditor.cs | 6 +- src/Debug/Editor/SettingsPrefs.cs | 23 ++- .../Editor/EntityTemplateEditor.cs | 139 +++++++++++++----- .../Templates/ComponentTemplateBase.cs | 8 +- src/Icons/AutosetCascadeIcon.png | Bin 0 -> 1990 bytes ...x.png.meta => AutosetCascadeIcon.png.meta} | 30 ++-- src/Icons/AutosetIcon.png | Bin 0 -> 1706 bytes ...n_max@2x.png.meta => AutosetIcon.png.meta} | 34 +++-- .../{d_winbtn_win_close.png => CloseIcon.png} | Bin ..._win_close.png.meta => CloseIcon.png.meta} | 30 ++-- ...{d_P4_DeletedLocal.png => CloseIconOn.png} | Bin ...tedLocal.png.meta => CloseIconOn.png.meta} | 30 ++-- src/Icons/{d__Help.png => HelpIcon.png} | Bin .../{d__Help.png.meta => HelpIcon.png.meta} | 30 ++-- src/Icons/UnlinkIcon.png | Bin 0 -> 647 bytes ..._Unlinked.png.meta => UnlinkIcon.png.meta} | 30 ++-- src/Icons/d_Unlinked.png | Bin 728 -> 0 bytes src/Icons/d_winbtn_win_max@2x.png | Bin 227 -> 0 bytes src/Icons/d_winbtn_win_restore@2x.png | Bin 283 -> 0 bytes src/Internal/Editor/EcsGUI.cs | 1 + src/Internal/EscEditorConsts.cs | 1 + 21 files changed, 255 insertions(+), 107 deletions(-) create mode 100644 src/Icons/AutosetCascadeIcon.png rename src/Icons/{d_winbtn_win_restore@2x.png.meta => AutosetCascadeIcon.png.meta} (83%) create mode 100644 src/Icons/AutosetIcon.png rename src/Icons/{d_winbtn_win_max@2x.png.meta => AutosetIcon.png.meta} (81%) rename src/Icons/{d_winbtn_win_close.png => CloseIcon.png} (100%) rename src/Icons/{d_winbtn_win_close.png.meta => CloseIcon.png.meta} (83%) rename src/Icons/{d_P4_DeletedLocal.png => CloseIconOn.png} (100%) rename src/Icons/{d_P4_DeletedLocal.png.meta => CloseIconOn.png.meta} (83%) rename src/Icons/{d__Help.png => HelpIcon.png} (100%) rename src/Icons/{d__Help.png.meta => HelpIcon.png.meta} (83%) create mode 100644 src/Icons/UnlinkIcon.png rename src/Icons/{d_Unlinked.png.meta => UnlinkIcon.png.meta} (83%) delete mode 100644 src/Icons/d_Unlinked.png delete mode 100644 src/Icons/d_winbtn_win_max@2x.png delete mode 100644 src/Icons/d_winbtn_win_restore@2x.png diff --git a/src/Debug/Editor/SettingsEditor.cs b/src/Debug/Editor/SettingsEditor.cs index 377cfaf..b782fc2 100644 --- a/src/Debug/Editor/SettingsEditor.cs +++ b/src/Debug/Editor/SettingsEditor.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System; using System.Collections.Generic; using System.Linq; using UnityEditor; @@ -29,7 +30,6 @@ namespace DCFApixels.DragonECS.Unity.Editors nameof(EcsConsts.DISABLE_DEBUG), nameof(EcsConsts.ENABLE_DUMMY_SPAN), nameof(EcsConsts.DISABLE_CATH_EXCEPTIONS), - "DEBUG", }; for (int i = 0; i < _defineSymbols.Count; i++) { @@ -74,11 +74,14 @@ namespace DCFApixels.DragonECS.Unity.Editors GUILayout.Label(nameof(SettingsPrefs.IsShowRuntimeComponents), GUILayout.ExpandWidth(false)); GUILayout.EndHorizontal(); + settings.AutoColorMode = (AutoColorMode)EditorGUILayout.EnumPopup(nameof(SettingsPrefs.AutoColorMode), SettingsPrefs.instance.AutoColorMode); + if (EditorGUI.EndChangeCheck()) { SettingsPrefs.instance.IsShowHidden = settings.IsShowHidden; SettingsPrefs.instance.IsShowInterfaces = settings.IsShowInterfaces; SettingsPrefs.instance.IsShowRuntimeComponents = settings.IsShowRuntimeComponents; + SettingsPrefs.instance.AutoColorMode = settings.AutoColorMode; } GUILayout.EndVertical(); @@ -144,6 +147,7 @@ namespace DCFApixels.DragonECS.Unity.Editors public bool IsShowHidden; public bool IsShowInterfaces; public bool IsShowRuntimeComponents; + public AutoColorMode AutoColorMode; } } } diff --git a/src/Debug/Editor/SettingsPrefs.cs b/src/Debug/Editor/SettingsPrefs.cs index 072e06b..22e81b6 100644 --- a/src/Debug/Editor/SettingsPrefs.cs +++ b/src/Debug/Editor/SettingsPrefs.cs @@ -4,8 +4,14 @@ using UnityEngine; namespace DCFApixels.DragonECS.Unity.Editors { - [FilePath(EcsConsts.FRAMEWORK_NAME + "/" + nameof(SettingsPrefs) + ".prefs", FilePathAttribute.Location.ProjectFolder)] - public class SettingsPrefs : ScriptableSingleton + internal enum AutoColorMode + { + Generic = 0, + Name = 1, + Rainbow = 2, + } + [FilePath(EcsConsts.AUTHOR + "/" + EcsConsts.FRAMEWORK_NAME + "/" + nameof(SettingsPrefs) + ".prefs", FilePathAttribute.Location.ProjectFolder)] + internal class SettingsPrefs : ScriptableSingleton { [SerializeField] private bool _isShowInterfaces = false; @@ -52,6 +58,19 @@ namespace DCFApixels.DragonECS.Unity.Editors Save(false); } } + + + [SerializeField] + private AutoColorMode _autoColorMode = AutoColorMode.Name; + public AutoColorMode AutoColorMode + { + get => _autoColorMode; + set + { + _autoColorMode = value; + Save(false); + } + } } } #endif \ No newline at end of file diff --git a/src/EntityTemplate/Editor/EntityTemplateEditor.cs b/src/EntityTemplate/Editor/EntityTemplateEditor.cs index 833b7fc..b30ec75 100644 --- a/src/EntityTemplate/Editor/EntityTemplateEditor.cs +++ b/src/EntityTemplate/Editor/EntityTemplateEditor.cs @@ -16,6 +16,12 @@ namespace DCFApixels.DragonECS.Unity.Editors private GenericMenu _genericMenu; private bool _isInit = false; + private static AutoColorMode AutoColorMode + { + get { return SettingsPrefs.instance.AutoColorMode; } + set { SettingsPrefs.instance.AutoColorMode = value; } + } + #region Init private void Init() { @@ -42,6 +48,11 @@ namespace DCFApixels.DragonECS.Unity.Editors var componentTemplateDummies = ComponentTemplateTypeCache.Dummies; foreach (var dummy in componentTemplateDummies) { + if (dummy.Type.GetCustomAttribute() == null) + { + Debug.LogWarning($"Type {dummy.Type.Name} does not have the [Serializable] attribute"); + continue; + } ITypeMeta meta = dummy is ITypeMeta metaOverride ? metaOverride : dummy.Type.ToMeta(); string name = meta.Name; string description = meta.Description.Text; @@ -112,7 +123,7 @@ namespace DCFApixels.DragonECS.Unity.Editors GUILayout.Label("", GUILayout.Height(0), GUILayout.ExpandWidth(true)); for (int i = 0; i < componentsProp.arraySize; i++) { - DrawComponentData(componentsProp.GetArrayElementAtIndex(i), i); + DrawComponentData(componentsProp.GetArrayElementAtIndex(i), componentsProp.arraySize, i); } GUILayout.EndVertical(); } @@ -132,37 +143,85 @@ namespace DCFApixels.DragonECS.Unity.Editors } } - private void DrawComponentData(SerializedProperty componentRefProp, int index) + private void DrawComponentData(SerializedProperty componentRefProp, int total, int index) { IComponentTemplate template = componentRefProp.managedReferenceValue as IComponentTemplate; if (template == null || componentRefProp.managedReferenceValue == null) { - DrawDamagedComponent(componentRefProp, index); + DrawDamagedComponent_Replaced(componentRefProp, index); + return; + } + + Type componentType; + SerializedProperty componentProperty = componentRefProp; + try + { + ComponentTemplateBase customTemplate = componentProperty.managedReferenceValue as ComponentTemplateBase; + if (customTemplate != null) + { + componentProperty = componentRefProp.FindPropertyRelative("component"); + componentType = customTemplate.GetType().GetField("component", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).FieldType; + } + else + { + componentType = componentProperty.managedReferenceValue.GetType(); + } + + if (componentType == null || componentProperty == null) + { + throw new NullReferenceException(); + } + } + catch (Exception e) + { + Debug.LogException(e, serializedObject.targetObject); + DrawDamagedComponent(index, "Damaged component template."); return; } - Type componentType; - SerializedProperty componentProperty = componentRefProp; - ComponentTemplateBase customInitializer = componentProperty.managedReferenceValue as ComponentTemplateBase; - if (customInitializer != null) - { - componentProperty = componentRefProp.FindPropertyRelative("component"); - componentType = customInitializer.GetType().GetField("component", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).FieldType; - } - else - { - componentType = componentProperty.managedReferenceValue.GetType(); ; - } + //сюда попадают уже валидные компоненты + ITypeMeta meta = template is ITypeMeta metaOverride ? metaOverride : template.Type.ToMeta(); string name = meta.Name; string description = meta.Description.Text; - Color panelColor = meta.Color.ToUnityColor().Desaturate(EscEditorConsts.COMPONENT_DRAWER_DESATURATE); - //GUIContent label = new GUIContent(name); bool isEmpty = componentType.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).Length <= 0; + var propsCounter = componentProperty.Copy(); + int lastDepth = propsCounter.depth; + bool next = propsCounter.Next(true) && lastDepth < propsCounter.depth; + int propCount = next ? -1 : 0; + while (next) + { + propCount++; + next = propsCounter.Next(false); + } float padding = EditorGUIUtility.standardVerticalSpacing; + + Color panelColor; + if (meta.IsCustomColor) + { + panelColor = meta.Color.ToUnityColor(); + } + else + { + switch (AutoColorMode) + { + case AutoColorMode.Name: + panelColor = meta.Color.ToUnityColor().Desaturate(0.48f) / 1.18f; //.Desaturate(0.48f) / 1.18f; + break; + case AutoColorMode.Rainbow: + Color hsv = Color.HSVToRGB(1f / (Mathf.Max(total, EscEditorConsts.AUTO_COLOR_RAINBOW_MIN_RANGE)) * index, 1, 1); + panelColor = hsv.Desaturate(0.48f) / 1.18f; + break; + default: + panelColor = index % 2 == 0 ? new Color(0.40f, 0.40f, 0.40f) : new Color(0.54f, 0.54f, 0.54f); + break; + } + } + panelColor = panelColor.Desaturate(EscEditorConsts.COMPONENT_DRAWER_DESATURATE); + Color alphaPanelColor = panelColor; alphaPanelColor.a = EscEditorConsts.COMPONENT_DRAWER_ALPHA; @@ -171,24 +230,27 @@ namespace DCFApixels.DragonECS.Unity.Editors EditorGUI.BeginChangeCheck(); GUILayout.BeginVertical(UnityEditorUtility.GetStyle(alphaPanelColor)); - - #region Draw Component Block - bool isRemoveComponent = false; removeButtonRect.yMin = removeButtonRect.yMax; removeButtonRect.yMax += RemoveButtonRect.height; removeButtonRect.xMin = removeButtonRect.xMax - RemoveButtonRect.width; removeButtonRect.center += Vector2.up * padding * 2f; - if (EcsGUI.CloseButton(removeButtonRect)) - { - isRemoveComponent = true; - } + bool isRemoveComponent = EcsGUI.CloseButton(removeButtonRect); - if (isEmpty) + if (propCount <= 0) { GUIContent label = UnityEditorUtility.GetLabel(name); - GUILayout.Label(label); + EditorGUILayout.LabelField(name); + Rect emptyPos = GUILayoutUtility.GetLastRect(); + emptyPos.xMin += EditorGUIUtility.labelWidth; + if (isEmpty) + { + using (new EcsGUI.ContentColorScope(1f, 1f, 1f, 0.4f)) + { + GUI.Label(emptyPos, "empty"); + } + } EditorGUI.BeginProperty(GUILayoutUtility.GetLastRect(), label, componentRefProp); EditorGUI.EndProperty(); } @@ -226,19 +288,28 @@ namespace DCFApixels.DragonECS.Unity.Editors EditorUtility.SetDirty(componentProperty.serializedObject.targetObject); } } - - private void DrawDamagedComponent(SerializedProperty componentRefProp, int index) + private void DrawDamagedComponent_Replaced(SerializedProperty componentRefProp, int index) { + DrawDamagedComponent(index, $"Damaged component template. If the problem occurred after renaming a component or initializer. use MovedFromAttrubute"); + } + private void DrawDamagedComponent(int index, string message) + { + Rect removeButtonRect = GUILayoutUtility.GetLastRect(); + GUILayout.BeginHorizontal(); - EditorGUILayout.HelpBox($"Damaged component. If the problem occurred after renaming a component or initializer. use MovedFromAttrubute", MessageType.Warning); + float padding = EditorGUIUtility.standardVerticalSpacing; - Rect lastrect = GUILayoutUtility.GetLastRect(); - Rect removeButtonRect = RemoveButtonRect; - removeButtonRect.center = new Vector2(lastrect.xMax + removeButtonRect.width, lastrect.yMin + removeButtonRect.height / 2f); + removeButtonRect.yMin = removeButtonRect.yMax; + removeButtonRect.yMax += RemoveButtonRect.height; + removeButtonRect.xMin = removeButtonRect.xMax - RemoveButtonRect.width; + removeButtonRect.center += Vector2.up * padding * 2f; - GUILayout.Label("", GUILayout.Width(removeButtonRect.width)); - if (GUI.Button(removeButtonRect, "x", _removeButtonStyle)) + bool isRemoveComponent = EcsGUI.CloseButton(removeButtonRect); + + EditorGUILayout.HelpBox(message, MessageType.Warning); + + if (isRemoveComponent) { OnRemoveComponentAt(index); } diff --git a/src/EntityTemplate/Templates/ComponentTemplateBase.cs b/src/EntityTemplate/Templates/ComponentTemplateBase.cs index df4f541..e8105d1 100644 --- a/src/EntityTemplate/Templates/ComponentTemplateBase.cs +++ b/src/EntityTemplate/Templates/ComponentTemplateBase.cs @@ -33,7 +33,9 @@ namespace DCFApixels.DragonECS { #region Properties public abstract Type Type { get; } + public virtual bool IsCustomName { get { return false; } } public virtual string Name { get { return string.Empty; } } + public virtual bool IsCustomColor { get { return false; } } public virtual MetaColor Color { get { return new MetaColor(MetaColor.Black); } } public virtual MetaGroup Group { get { return MetaGroup.Empty; } } public virtual MetaDescription Description { get { return MetaDescription.Empty; } } @@ -58,11 +60,13 @@ namespace DCFApixels.DragonECS #region Properties public override Type Type { get { return typeof(T); } } + public override bool IsCustomName { get { return Meta.IsCustomName; } } public override string Name { get { return Meta.Name; } } + public override bool IsCustomColor { get { return Meta.IsCustomColor; } } + public override MetaColor Color { get { return Meta.Color; } } public override MetaGroup Group { get { return Meta.Group; } } public override MetaDescription Description { get { return Meta.Description; } } public override IReadOnlyCollection Tags { get { return Meta.Tags; } } - public override MetaColor Color { get { return Meta.Color; } } #endregion #region Methods @@ -129,7 +133,7 @@ namespace DCFApixels.DragonECS.Unity.Editors Type interfaceType = typeof(IComponentTemplate); foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) { - var targetTypes = assembly.GetTypes().Where(type => !type.IsGenericType && !(type.IsAbstract || type.IsInterface) && type.GetCustomAttribute() != null); + var targetTypes = assembly.GetTypes().Where(type => !type.IsGenericType && !(type.IsAbstract || type.IsInterface) /*&& type.GetCustomAttribute() != null*/); types.AddRange(targetTypes.Where(type => interfaceType.IsAssignableFrom(type))); diff --git a/src/Icons/AutosetCascadeIcon.png b/src/Icons/AutosetCascadeIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..2ad48f625bbbef4926b1399af39d002c3f2e33d0 GIT binary patch literal 1990 zcmbVNeQeZZ94;FhV=#lxY`9=3T~I`N{kpqe8x9zElMT4Jj2jyoaJ}~JuI}zy+irK8 z1a}CA4H6_65E&wjgmB1Y1on?nmXQ!pLKZMO1Ly>T5`v1d1Y!)ny}O-&e8o$8ecL|o z^E|(g{@PJpwV)usBp*SLg31bS4LqaPk(UeqjkdO%@HAelSY{x|ghJ~WgM8FA89{PR zD*k%2-nW<+)v!&F)Bv!>!Wu*)$n3c>O%R)ai3UKU5^-a{eSQ=}70Hd&Ieer~^MIgI z(WZkXZB>4;tx4o0Z0;O%c8rGvVPFbqEF6j$e9Vm{d3m_DZW9=qgqTfktjrQb>wVRz zN7Vt!*(h8jNeX2-o8Xe{tb>__(j?6gBty^)PP%x9lV?~o{llP~F3Eh2_m#95ymDhf z)6{r^h(@EfC}UIgMuOrvjv#4*rg4bCjn;@M#PEnwI?CV$hNvr=si+auViW>uv+2g5 z)l>{&EkheI(s_azBVvL^P&U$vDG8Ls3{Gp-LrHN-BtQs+LBup5mdaqYplYf{P<;q> z=J7oOFtG0Ir(7??@{wc;>Qf~} zZoLoc@RKCZFua|<2MT*e5=`N-U`ga(&&D#DmGh{ zwf3jFTvA2I@vkaJbBx{YkZ~s`N;o6g?T{@Hz-fo%WLQ?_oD@6C_NuPH7flG=&1$)l zAR{MIQXn9aILFEiE|7K_cgZe*J1IeCoDP{3W!CEEWP|V(iUCX4ntnf)fVa}Ckb)+A zf)_-q*WH+C71@d>bz6BrKAuQ9y+0ZRkn|D7PstdnY(@nglr_TKJ+`@shnY8omPcEE zvQnlz-Dmy3&G>(;r_&+^g-9cSlas)#U4h^U$5k|yT;Kd9L_jvnVGKeA~T;s z1XAm8`p!$x0R$P-UFj|J*RQ?4rFUU=*`)W5u0wYh9UmC@u6p~vGYfByKU{OTwru;* zw)Pp5EA|BoclQ5Mx_H+O$FsBigF}0`_2*8se*g7>tzBCOjxHOzuYdwSi1X|>+VDAk@Qisud% zZR%Y!sjBm<_;Tjgz0XbAZ8ZF_VPse;;ht{JT7qDIl;o|*?TN4UXs15T8YKIcj(oa$ z-tX9|`F(Ns@XWkoVe`19@xo8`B%;`vim~(17rlF~1R9X01pm~OpWawr+}>1r=*pVz z)1Eo2PK=BValK=^#u&T4*x0{i-T9V~f8^YP`o9lfT(n3#b$;#s&8rZ(u%}>R1KOE& z>qN=$w5ImNyVs3@BQfM`?@X%i+O6ru-xeOcnm_6G)VzhYKi;?&d!Z-i_0XUF69%8z z)U#svwVWMY^?&)a?gGXcUf;9hVCS7f&+ku+`=eQM*I)|a-jyvo}%zhU)1 DE@G+g literal 0 HcmV?d00001 diff --git a/src/Icons/d_winbtn_win_restore@2x.png.meta b/src/Icons/AutosetCascadeIcon.png.meta similarity index 83% rename from src/Icons/d_winbtn_win_restore@2x.png.meta rename to src/Icons/AutosetCascadeIcon.png.meta index 343fb69..641eceb 100644 --- a/src/Icons/d_winbtn_win_restore@2x.png.meta +++ b/src/Icons/AutosetCascadeIcon.png.meta @@ -3,10 +3,10 @@ guid: 8f9fb2a8877577940971d81a98aeaaaa TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 13 + serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -20,12 +20,11 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 - flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 - ignoreMipmapLimit: 0 + ignoreMasterTextureLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -52,7 +51,7 @@ TextureImporter: spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 - alphaIsTransparency: 0 + alphaIsTransparency: 1 spriteTessellationDetail: -1 textureType: 0 textureShape: 1 @@ -64,20 +63,17 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 - swizzle: 50462976 - cookieLightType: 0 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 - resizeAlgorithm: 0 + resizeAlgorithm: 1 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 3 @@ -90,7 +86,18 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: @@ -107,8 +114,9 @@ TextureImporter: weights: [] secondaryTextures: [] nameFileIdTable: {} - mipmapLimitGroupName: + spritePackingTag: pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/src/Icons/AutosetIcon.png b/src/Icons/AutosetIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..b1f790d26fe7a25a3c4d0b1d4495827cc63db443 GIT binary patch literal 1706 zcmbVNZEO=|9KXH7=7zy-aW309Zy5n*dw0EdZO@f$tiyJpquH9hkSyVP_q4sW_u}1^ zc8vpPFoKFR3b-w5rjcljPLiQUO`!7wOfrlblSKo%NL&bm`auI1KNOR7tKn7k>MmiFvbNLq7kH}H7+x37-*;;1bNYc{qfZq4COfo)^G6;9=QXA zcvnIJy@_rgn+UUZ4r|?xw!~>jAOMX)<3dDK>9_++^U`pwzs4~%4bj35tX(&V4tTt1 zhok`1ZX^vXL6E4`Ze(nn*=nJlKuv^+!U+mDQ3k?BTbgOgie?TBnp3y{-Q(PuF$SL; zSV+@k8pmU?m@!5fB_)WHcDo%XOt{HpfCz&+B5F+BAgT>n1}9Kig_kv65>cIz@k>$7 zfk9W-GzfBzR#Y=_f)T^xjEs{;Lf4cAa%>JKN0mt0ILG230t6sxD#VgGtQ?XwNexN= zLY@13hXEK{k0)p2p1ue|&V;IU?t?Ni0l6ny^^M2??*Xb5Ranru54zc)tC8sr1u&YV z_#`Qk&6GFmGHNm#t>~71UgV^hy7jgVz{zO9fx)bq4TQx&Qa;i~n@F0pHNo@|#2VBi zaeQFpE~v#v5Hv;7X3HH=STh`>G4};?EFF*(fq{Z~fe8X!7K0d?3nSejMI;3phTc(W zFFYRFEvgzLvcT=Q*0P1W49o4H&G11waAjW`o}ZtHw&$Z5BIeVr$Qf49QJ)?y+L%%eA)UJ|s6S7EY7G9A$ip3bZyJesZonql?oc3`ZYR={DI z*Zc!VV2w5w0+94S(!B;#rGOS=6wn@o(YkLr;m~_-RA4q$NBL*xSEqUxCjVSbExbj&{?faL z_76{gl6tJI7%AI-4CPC<44H<#6ZfAMQ4vbft;ajxso z$Q$2&IXwDWxajQkss(ZFL5ySH9JP-pKb*XDYPoB8v8(3_*%F(m7#})VSynW0V}9~# zV{*KyU>@0#mvSieiIS5WeyqD3-D`Mndc~AD@zdPqXYh9p){HEbgeC_4R_){DP;LKd zwm#hO%BQCa7l*w0%VVs2qnDh0bW^|kvU%?2lf#WyZ*F(dXlZgYvF_#g)aks>+qPbR m{I~M&!mD5GJeqf__1TAm&TtA8+^W+5ChpE|=gf}1&;0{*#ynU6 literal 0 HcmV?d00001 diff --git a/src/Icons/d_winbtn_win_max@2x.png.meta b/src/Icons/AutosetIcon.png.meta similarity index 81% rename from src/Icons/d_winbtn_win_max@2x.png.meta rename to src/Icons/AutosetIcon.png.meta index 7125548..c253200 100644 --- a/src/Icons/d_winbtn_win_max@2x.png.meta +++ b/src/Icons/AutosetIcon.png.meta @@ -3,10 +3,10 @@ guid: d01e651682f48b548b597714f47e14b9 TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 13 + serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -20,12 +20,11 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 - flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 - ignoreMipmapLimit: 0 + ignoreMasterTextureLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -43,7 +42,7 @@ TextureImporter: nPOTScale: 0 lightmap: 0 compressionQuality: 50 - spriteMode: 2 + spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 @@ -52,7 +51,7 @@ TextureImporter: spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 - alphaIsTransparency: 0 + alphaIsTransparency: 1 spriteTessellationDetail: -1 textureType: 0 textureShape: 1 @@ -64,20 +63,17 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 - swizzle: 50462976 - cookieLightType: 0 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 - resizeAlgorithm: 0 + resizeAlgorithm: 1 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 3 @@ -90,7 +86,18 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: @@ -99,7 +106,7 @@ TextureImporter: outline: [] physicsShape: [] bones: [] - spriteID: + spriteID: 5e97eb03825dee720800000000000000 internalID: 0 vertices: [] indices: @@ -107,8 +114,9 @@ TextureImporter: weights: [] secondaryTextures: [] nameFileIdTable: {} - mipmapLimitGroupName: + spritePackingTag: pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/src/Icons/d_winbtn_win_close.png b/src/Icons/CloseIcon.png similarity index 100% rename from src/Icons/d_winbtn_win_close.png rename to src/Icons/CloseIcon.png diff --git a/src/Icons/d_winbtn_win_close.png.meta b/src/Icons/CloseIcon.png.meta similarity index 83% rename from src/Icons/d_winbtn_win_close.png.meta rename to src/Icons/CloseIcon.png.meta index 26a947b..8a67a2d 100644 --- a/src/Icons/d_winbtn_win_close.png.meta +++ b/src/Icons/CloseIcon.png.meta @@ -3,10 +3,10 @@ guid: 8a708e50662813d4a99c107e6431a60b TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 13 + serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -20,12 +20,11 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 - flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 - ignoreMipmapLimit: 0 + ignoreMasterTextureLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -52,7 +51,7 @@ TextureImporter: spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 - alphaIsTransparency: 0 + alphaIsTransparency: 1 spriteTessellationDetail: -1 textureType: 0 textureShape: 1 @@ -64,20 +63,17 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 - swizzle: 50462976 - cookieLightType: 0 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 - resizeAlgorithm: 0 + resizeAlgorithm: 1 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 3 @@ -90,7 +86,18 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: @@ -107,8 +114,9 @@ TextureImporter: weights: [] secondaryTextures: [] nameFileIdTable: {} - mipmapLimitGroupName: + spritePackingTag: pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/src/Icons/d_P4_DeletedLocal.png b/src/Icons/CloseIconOn.png similarity index 100% rename from src/Icons/d_P4_DeletedLocal.png rename to src/Icons/CloseIconOn.png diff --git a/src/Icons/d_P4_DeletedLocal.png.meta b/src/Icons/CloseIconOn.png.meta similarity index 83% rename from src/Icons/d_P4_DeletedLocal.png.meta rename to src/Icons/CloseIconOn.png.meta index 046fdf1..7904d9f 100644 --- a/src/Icons/d_P4_DeletedLocal.png.meta +++ b/src/Icons/CloseIconOn.png.meta @@ -3,10 +3,10 @@ guid: 6a1d402595b00c24db2ba647fed93a5c TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 13 + serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -20,12 +20,11 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 - flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 - ignoreMipmapLimit: 0 + ignoreMasterTextureLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -52,7 +51,7 @@ TextureImporter: spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 - alphaIsTransparency: 0 + alphaIsTransparency: 1 spriteTessellationDetail: -1 textureType: 0 textureShape: 1 @@ -64,20 +63,17 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 - swizzle: 50462976 - cookieLightType: 0 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 - resizeAlgorithm: 0 + resizeAlgorithm: 1 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 3 @@ -90,7 +86,18 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: @@ -107,8 +114,9 @@ TextureImporter: weights: [] secondaryTextures: [] nameFileIdTable: {} - mipmapLimitGroupName: + spritePackingTag: pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/src/Icons/d__Help.png b/src/Icons/HelpIcon.png similarity index 100% rename from src/Icons/d__Help.png rename to src/Icons/HelpIcon.png diff --git a/src/Icons/d__Help.png.meta b/src/Icons/HelpIcon.png.meta similarity index 83% rename from src/Icons/d__Help.png.meta rename to src/Icons/HelpIcon.png.meta index 439d0b0..fdee6d6 100644 --- a/src/Icons/d__Help.png.meta +++ b/src/Icons/HelpIcon.png.meta @@ -3,10 +3,10 @@ guid: e135cf23a5d53ce48a75e163b41e39d5 TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 13 + serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -20,12 +20,11 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 - flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 - ignoreMipmapLimit: 0 + ignoreMasterTextureLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -52,7 +51,7 @@ TextureImporter: spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 alphaUsage: 1 - alphaIsTransparency: 0 + alphaIsTransparency: 1 spriteTessellationDetail: -1 textureType: 0 textureShape: 1 @@ -64,20 +63,17 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 - swizzle: 50462976 - cookieLightType: 0 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 - resizeAlgorithm: 0 + resizeAlgorithm: 1 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - serializedVersion: 3 @@ -90,7 +86,18 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: @@ -107,8 +114,9 @@ TextureImporter: weights: [] secondaryTextures: [] nameFileIdTable: {} - mipmapLimitGroupName: + spritePackingTag: pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/src/Icons/UnlinkIcon.png b/src/Icons/UnlinkIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..f6f1004fc8d96971889366b48644e75ee5b4730e GIT binary patch literal 647 zcmV;20(kw2P)y!+0* z@7#~~YW;qnVPe}*y^jJI1@J!vu)S!(%nkuceGR0*%o@OZ zU>tY}OiKFV=~x1e;OW??JIrhsun3&+gB*~wlC_CaFyqeGQs)5ftO>kjlZEMfC!K5D zxz{05-~+G^xFhL$aH;_%fW3aoH{_Hi!+&1{L`O*qYn>9nN0MAG zxlJA^S0lerI0*|d2DJQtlfO!&g_+uH8j%8Nk(|sgNO}#N0d@k%7*t}xZSqLDR`Lr` z4cr4RlN8RuvFKu@9oQ zfA)Y!z$@T;&h)9IpMG<$G1whvfm?1n9Sx$e2qn#%S%qsr?A(!qV2+c)Cpv$IJ6hQ@=BDf9LLf}SS4Z6^U z8>L7}cM+r;K?0eQ z17~8lpi-%HVw(U1rBdlf%Xw*2{JSoMS`6q2B+Ez3 z@h^$GdD377Oz`{-=&To=58FU|E}uIwnnRdavzxQ1%1*5&{7mSrHJB3loLDRd{E*zO z&jNjG==#A0a2wP!G3k6T1>$r0+=O(Z)Joi{zMTb!+X|Js}ncQ;y;Y+%edxQ;jKz}30$#j`UnGJRw6zonJ%=Hb_Sm+hCD zi+>bw%6s}!xTApsi1zq3++%%_QqceX+^1`n@ktl7zJ2uMT+o~4Ys0ni`=v=6cl=RO bV5(Q1q&H#it)AIHS2K9J`njxgN@xNAM|EG? diff --git a/src/Icons/d_winbtn_win_restore@2x.png b/src/Icons/d_winbtn_win_restore@2x.png deleted file mode 100644 index dc22a341c8aef5c7ee156b6e94972c56b948e2c2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 283 zcmV+$0p$LPP)N$H0r(D3SEKr^)wL`o ziOE;m5Qe{iTIxt3K7iXXySH!JY3 hoG6LwTopKn0$=a}Nr4Sy+6@2z002ovPDHLkV1l9JboKxM diff --git a/src/Internal/Editor/EcsGUI.cs b/src/Internal/Editor/EcsGUI.cs index c7e7ef4..679e47b 100644 --- a/src/Internal/Editor/EcsGUI.cs +++ b/src/Internal/Editor/EcsGUI.cs @@ -39,6 +39,7 @@ namespace DCFApixels.DragonECS.Unity.Editors public struct ContentColorScope : IDisposable { private readonly Color _value; + public ContentColorScope(float r, float g, float b, float a = 1f) : this(new Color(r, g, b, a)) { } public ContentColorScope(Color value) { _value = GUI.contentColor; diff --git a/src/Internal/EscEditorConsts.cs b/src/Internal/EscEditorConsts.cs index 9307e9a..d3a7c88 100644 --- a/src/Internal/EscEditorConsts.cs +++ b/src/Internal/EscEditorConsts.cs @@ -4,5 +4,6 @@ { public const float COMPONENT_DRAWER_ALPHA = 0.26f; public const float COMPONENT_DRAWER_DESATURATE = 0.86f; + public const int AUTO_COLOR_RAINBOW_MIN_RANGE = 7; } }