From d9fa3641e36b84c976b6282ca5013c4d5248df41 Mon Sep 17 00:00:00 2001 From: mob-sakai <12690315+mob-sakai@users.noreply.github.com> Date: Thu, 26 Nov 2026 23:57:36 +0900 Subject: [PATCH] fix: improve round corner inspector --- Packages/src/Editor/Icons/PasteIcon.png | Bin 1135 -> 514 bytes Packages/src/Editor/Icons/RoundCornerIcon.png | Bin 0 -> 696 bytes .../src/Editor/Icons/RoundCornerIcon.png.meta | 109 +++++++++++++++++ .../src/Editor/Icons/UIEffectIconIcon.png | Bin 2304 -> 1262 bytes .../src/Editor/Icons/d_RoundCornerIcon.png | Bin 0 -> 697 bytes .../Editor/Icons/d_RoundCornerIcon.png.meta | 109 +++++++++++++++++ Packages/src/Editor/UIEffectPropertyEditor.cs | 112 +++++++++++++++--- Packages/src/README.md | 6 +- .../src/Runtime/Internal/Utilities/Misc.cs | 8 ++ Packages/src/Runtime/UIEffectContext.cs | 2 + 10 files changed, 324 insertions(+), 22 deletions(-) create mode 100644 Packages/src/Editor/Icons/RoundCornerIcon.png create mode 100644 Packages/src/Editor/Icons/RoundCornerIcon.png.meta create mode 100644 Packages/src/Editor/Icons/d_RoundCornerIcon.png create mode 100644 Packages/src/Editor/Icons/d_RoundCornerIcon.png.meta diff --git a/Packages/src/Editor/Icons/PasteIcon.png b/Packages/src/Editor/Icons/PasteIcon.png index 9f389587ca0dd3b20df46f357df6ec2751737c5b..71932009ca913c6905a5e810b4f5443ec2681a49 100644 GIT binary patch delta 499 zcmVA+a(Vt_*je+IrI7LL<4q|8&Wv=hu&u zoU~;4XCMPdG({5*GHH~r!Gl!s>?$o6aSrK^-Js=xJf@I8GJieZqh%qkR8bEXvwW)6 zB`q2pVBov#MfIzkOJ5WgC(wtSkF!NHoGnOSdXyxEO}h>k6UbkACk4ik0U6^4dC~(} zJVOTN#V(RUlrRX{^(87=XCGXiLI_sS=nlIMsUx6rO>x1aI>arqVFkhkA=G*lUqE$u zDMu7tfY#J{N`D;OCH1u-pI*rS^#w!$yh0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~ErD#r|0jE=0w`fN+p=WP6?EjiT{C{TvAi_iLz|fm| zGIJII+Gl&JmxauqW<|n=KG|Kr^0C>GV4OTNNFWa9o)tzHOZxog!~w=GHhNAlP96Xf zUA_$f?wipCtcsU=H|xojdViEsFB7P1)ZLz6=d7FDO`l{L$xg-%_@y!?FvJ+X|3Qi8OkoW$0m+u`S zehtOR1Hd8>y%I0?4aPhD*Lbn<#52`?7$HGcru3&7&<5BM!6F;Evc za}u!Wfa^&<*0cI{%4GL2=y3p|4ST>;8SjX!P^;x7FxKO(mDAa`Y>_9tBf1<97~1Ev z$|DT=F6@(^vJ9*fMSjFm1YGa1&tX{dE}#l(As_&t!lKgPvd97ComWtLcFGKt2c2a{;?W7pyZP@2yW*0E&gj<3V4{tG>LQBXk- zz8n<1cn%oxq$o&KM5D&|7K2GP*&Q!l7M5j$*$2V-p62j_=flG@hnYvwdtW$b%?%hf zWI(@)l2p*C)wUBS07|+qHDJgl+l(9Yu@Qr+syYJ}TP8|?y3=a`1gSn-d~2UwHY-b| z5^rtt$wxNm=ERYqVRYeZfW(4!&7F_sX>64*JIhvl_iW1B3SZ%XTSp^Ctc8vM1_s z4q?qMfBHfO9y;Tws}}U2M7zH7yRTKi9mgFqWdVq>1EVJFlY#rrIN}<_0%Z31*&uQ+ zop-F4%adp=vDIEXz=}yHT_Gl*>?b=VXn5qXOT+}EMto-*cA17j*+)^)4I z22^}115e%2j1S0+D1&(qVgX7m&l{v*(KC7c9Z1y#uwqesfFKhC;$bZ2W842x2j2eK-~%mN|Me$se(izx4tC;0PO(@plY+~Is(d8Fr*)l z&>qkS*y%rY>sP9Q%ytmeXb;E$qek_z@;mezmbBF4?}8w7zO=fnH#H?%`>g#A9MGF` fp}3$ddS`nLN-vb*X5tT400000NkvXXu0mjfC(SgD literal 0 HcmV?d00001 diff --git a/Packages/src/Editor/Icons/d_RoundCornerIcon.png.meta b/Packages/src/Editor/Icons/d_RoundCornerIcon.png.meta new file mode 100644 index 0000000..7648405 --- /dev/null +++ b/Packages/src/Editor/Icons/d_RoundCornerIcon.png.meta @@ -0,0 +1,109 @@ +fileFormatVersion: 2 +guid: c58c458b53265474ea456ff2861bd6fd +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/src/Editor/UIEffectPropertyEditor.cs b/Packages/src/Editor/UIEffectPropertyEditor.cs index 01bb0f3..068c6ff 100644 --- a/Packages/src/Editor/UIEffectPropertyEditor.cs +++ b/Packages/src/Editor/UIEffectPropertyEditor.cs @@ -21,6 +21,7 @@ namespace Coffee.UIEffects.Editors private static GUIContent s_PasteColorContent; private static GUIContent s_PasteGradientContent; + private static GUIContent s_RoundCornerIconContent; private static readonly GUIContent s_RotationLabel = new GUIContent("* Rotation"); private static readonly GUIContent s_KeepAspectRatioLabel = new GUIContent("* Keep Aspect Ratio"); @@ -110,24 +111,31 @@ namespace Coffee.UIEffects.Editors private SerializedProperty _detailTexSpeed; private SerializedProperty _roundCornerMode; - private SerializedProperty _roundCornerRadiusTopLeft; - private SerializedProperty _roundCornerRadiusTopRight; - private SerializedProperty _roundCornerRadiusBottomRight; - private SerializedProperty _roundCornerRadiusBottomLeft; + private SerializedProperty _roundCornerRadius; + private SerializedProperty _roundCornerRadiusTL; + private SerializedProperty _roundCornerRadiusTR; + private SerializedProperty _roundCornerRadiusBR; + private SerializedProperty _roundCornerRadiusBL; + private bool _roundCornerRadiiLinked; private SerializedProperty _flip; protected virtual void OnEnable() { + const string iconDir = "Packages/com.coffee.ui-effect/Editor/Icons"; if (s_PasteColorContent == null) { - var iconDir = "Packages/com.coffee.ui-effect/Editor/Icons"; s_PasteColorContent = Misc.GetIconContent($"{iconDir}/PasteIcon.png", $"Paste {PasteColorUtil.SupportedFormats} or CSS background/background-color declarations."); s_PasteGradientContent = Misc.GetIconContent($"{iconDir}/PasteIcon.png", "Paste CSS linear-gradient(...) or radial-gradient(...)."); } + if (s_RoundCornerIconContent == null) + { + s_RoundCornerIconContent = Misc.GetIconContent($"{iconDir}/RoundCornerIcon.png"); + } + _toneFilter = serializedObject.FindProperty("m_ToneFilter"); _toneIntensity = serializedObject.FindProperty("m_ToneIntensity"); @@ -217,11 +225,21 @@ namespace Coffee.UIEffects.Editors _detailTexSpeed = serializedObject.FindProperty("m_DetailTexSpeed"); _roundCornerMode = serializedObject.FindProperty("m_RoundCornerMode"); - var roundCornerRadius = serializedObject.FindProperty("m_RoundCornerRadius"); - _roundCornerRadiusTopLeft = roundCornerRadius.FindPropertyRelative("x"); - _roundCornerRadiusTopRight = roundCornerRadius.FindPropertyRelative("y"); - _roundCornerRadiusBottomRight = roundCornerRadius.FindPropertyRelative("z"); - _roundCornerRadiusBottomLeft = roundCornerRadius.FindPropertyRelative("w"); + _roundCornerRadius = serializedObject.FindProperty("m_RoundCornerRadius"); + _roundCornerRadiusTL = _roundCornerRadius.FindPropertyRelative("x"); + _roundCornerRadiusTR = _roundCornerRadius.FindPropertyRelative("y"); + _roundCornerRadiusBR = _roundCornerRadius.FindPropertyRelative("z"); + _roundCornerRadiusBL = _roundCornerRadius.FindPropertyRelative("w"); + _roundCornerRadiiLinked = !_roundCornerRadiusTL.hasMultipleDifferentValues + && !_roundCornerRadiusTR.hasMultipleDifferentValues + && !_roundCornerRadiusBR.hasMultipleDifferentValues + && !_roundCornerRadiusBL.hasMultipleDifferentValues + && Mathf.Approximately(_roundCornerRadiusTL.floatValue, + _roundCornerRadiusTR.floatValue) + && Mathf.Approximately(_roundCornerRadiusTL.floatValue, + _roundCornerRadiusBR.floatValue) + && Mathf.Approximately(_roundCornerRadiusTL.floatValue, + _roundCornerRadiusBL.floatValue); _flip = serializedObject.FindProperty("m_Flip"); } @@ -507,10 +525,7 @@ namespace Coffee.UIEffects.Editors if (DrawHeaderPopup(_roundCornerMode)) { EditorGUI.indentLevel++; - DrawRoundCornerRadiusField(_roundCornerRadiusTopLeft, "Top Left"); - DrawRoundCornerRadiusField(_roundCornerRadiusTopRight, "Top Right"); - DrawRoundCornerRadiusField(_roundCornerRadiusBottomRight, "Bottom Right"); - DrawRoundCornerRadiusField(_roundCornerRadiusBottomLeft, "Bottom Left"); + DrawRoundCornerRadii(); EditorGUI.indentLevel--; } @@ -539,13 +554,72 @@ namespace Coffee.UIEffects.Editors EditorGUI.indentLevel = indentLevel; } - private static void DrawRoundCornerRadiusField(SerializedProperty property, string label) + private void DrawRoundCornerRadii() { - EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(property, EditorGUIUtility.TrTempContent(label)); - if (EditorGUI.EndChangeCheck()) + var radii = _roundCornerRadius; + var lineH = EditorGUIUtility.singleLineHeight; + var r = EditorGUILayout.GetControlRect(false, lineH * 2 + 2); + var labelW = EditorGUIUtility.labelWidth; + var controlX = r.x + labelW; + var controlW = r.width - labelW; + var fieldW = (controlW - 48) / 2; + var leftIconX = controlX; + var leftFieldX = leftIconX + 4; + var linkX = leftFieldX + fieldW + 10; + var rightFieldX = linkX + 14; + var rightIconX = rightFieldX + fieldW + 2; + var bottomY = r.y + lineH + 2; + var prefixPos = new Rect(r.x, r.y, r.width, lineH); + + // Label { - property.floatValue = Mathf.Max(0, property.floatValue); + var label = EditorGUIUtility.TrTempContent("Corner Radii"); + label = EditorGUI.BeginProperty(prefixPos, label, _roundCornerRadius); + EditorGUI.PrefixLabel(prefixPos, label); + } + + // Link toggle + { + var linkRect = new Rect(linkX, r.y + (r.height - 22) * 0.5f, 22, 22); + var linkContent = EditorGUIUtility.IconContent(_roundCornerRadiiLinked ? "Linked" : "Unlinked"); + EditorGUI.BeginChangeCheck(); + _roundCornerRadiiLinked = GUI.Toggle(linkRect, _roundCornerRadiiLinked, linkContent, "IconButton"); + if (EditorGUI.EndChangeCheck()) + { + var v = Mathf.Max(0, _roundCornerRadiusTL.floatValue); + radii.vector4Value = new Vector4(v, v, v, v); + } + } + + // Draw fields + var linked = _roundCornerRadiiLinked; + Misc.DrawIconContent(new Rect(leftIconX, r.y, 18, 18), s_RoundCornerIconContent, 0); + DrawRadiusField(new Rect(leftFieldX, r.y, fieldW, lineH), _roundCornerRadiusTL, radii, linked); + + Misc.DrawIconContent(new Rect(rightIconX, r.y, 18, 18), s_RoundCornerIconContent, 90); + DrawRadiusField(new Rect(rightFieldX, r.y, fieldW, lineH), _roundCornerRadiusTR, radii, linked); + + Misc.DrawIconContent(new Rect(rightIconX, bottomY, 18, 18), s_RoundCornerIconContent, 180); + DrawRadiusField(new Rect(leftFieldX, bottomY, fieldW, lineH), _roundCornerRadiusBL, radii, linked); + + Misc.DrawIconContent(new Rect(leftIconX, bottomY, 18, 18), s_RoundCornerIconContent, 270); + DrawRadiusField(new Rect(rightFieldX, bottomY, fieldW, lineH), _roundCornerRadiusBR, radii, linked); + + EditorGUI.EndProperty(); + return; + + static void DrawRadiusField(Rect rect, SerializedProperty radius, SerializedProperty radii, bool linked) + { + EditorGUI.BeginChangeCheck(); + EditorGUI.PropertyField(rect, radius, GUIContent.none); + if (!EditorGUI.EndChangeCheck()) return; + + var v = Mathf.Max(0, radius.floatValue); + radius.floatValue = v; + if (linked) + { + radii.vector4Value = new Vector4(v, v, v, v); + } } } diff --git a/Packages/src/README.md b/Packages/src/README.md index f6e56a4..88d76ad 100644 --- a/Packages/src/README.md +++ b/Packages/src/README.md @@ -455,10 +455,10 @@ The `UIEffect` component applies visual effects to UI elements, allowing various #### Round Corner -![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/1795682060095.png) +![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/1795709212318.png) - **Mode**: `Off` or `On`. The default is `Off`. -- **Top Left**, **Top Right**, **Bottom Right**, **Bottom Left**: Set each corner radius independently. +- **Corner Radii**: Set each corner radius independently. ![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/1795681588650.png) - Radius values use `transitionRoot` local units. They are normalized against its shorter dimension and clamped to half that dimension; `0` keeps a corner square. - The mask applies to the main UI surface; Shadow and Mirror outputs are left unchanged to avoid shadow-edge artifacts. @@ -491,7 +491,7 @@ The `UIEffect` component applies visual effects to UI elements, allowing various > [!TIP] > `Transition Filter`, `Gradation Filter`, `Detail Filter`, and `Round Corner` use their effect root for local-coordinate calculations. > For example, if the mesh shape exceeds the `RectTransform` boundaries, the effect may not be applied correctly. -> By specifying `Custom Root`, you can refer to the specified transform. +> By specifying `Custom Root`, you can refer to the specified transform. > ![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/uieffect5.7.0-sample-custom-root.gif)

diff --git a/Packages/src/Runtime/Internal/Utilities/Misc.cs b/Packages/src/Runtime/Internal/Utilities/Misc.cs index e8d379b..b7ace7b 100644 --- a/Packages/src/Runtime/Internal/Utilities/Misc.cs +++ b/Packages/src/Runtime/Internal/Utilities/Misc.cs @@ -108,6 +108,14 @@ namespace Coffee.UIEffectInternal var icon = AssetDatabase.LoadAssetAtPath(iconPath); return new GUIContent(icon, tooltip); } + + public static void DrawIconContent(Rect rect, GUIContent content, float angle = 0f) + { + var matrix = GUI.matrix; + GUIUtility.RotateAroundPivot(angle, rect.center); + GUI.Label(rect, content); + GUI.matrix = matrix; + } #endif } diff --git a/Packages/src/Runtime/UIEffectContext.cs b/Packages/src/Runtime/UIEffectContext.cs index ebec82a..735111b 100644 --- a/Packages/src/Runtime/UIEffectContext.cs +++ b/Packages/src/Runtime/UIEffectContext.cs @@ -72,8 +72,10 @@ namespace Coffee.UIEffects private static readonly int s_RoundCornerViewMatrix = Shader.PropertyToID("_RoundCornerViewMatrix"); private static readonly int s_GradViewMatrix = Shader.PropertyToID("_GradViewMatrix"); private static readonly int s_MirrorRootViewMatrix = Shader.PropertyToID("_MirrorRootViewMatrix"); + private static readonly int s_MirrorRoundCornerViewMatrix = Shader.PropertyToID("_MirrorRoundCornerViewMatrix"); + private static readonly int s_MirrorGradViewMatrix = Shader.PropertyToID("_MirrorGradViewMatrix"); private static readonly int s_CanvasToWorldMatrix = Shader.PropertyToID("_CanvasToWorldMatrix");