diff --git a/CHANGELOG.md b/CHANGELOG.md index 48330b4..d49231e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +### Added +- Added dependency to [ManeTools-Unity](https://github.com/ManeFunction/ManeTools-Unity.git). + +### Changed +- `OptionalSizeField` replaced with universal `LimitedValueField` from the dependent package. +- Moved context "Add component" menu to `Mane Tools -> UI -> DOTween UI Controller`. + ## [2.1.0] - 2026-09-02 ### Added diff --git a/Editor/DOTweenUIController.uss b/Editor/DOTweenUIController.uss index 0b9c300..fd9ce50 100644 --- a/Editor/DOTweenUIController.uss +++ b/Editor/DOTweenUIController.uss @@ -1,108 +1,35 @@ -/* Tween block styling */ -.tween-block { - border-width: 1px; - border-color: #555; - padding: 5px; - margin-top: 5px; - margin-bottom: 5px; - padding-bottom: 4px; -} -.tween-block .unity-toggle__text { - margin-left: 5px; -} - -/* Header styling */ -.header { - font-size: 14px; - -unity-font-style: bold; - margin-left: 2px; - margin-bottom: 5px; -} - -/* Header toggle styling */ -.tween-header .unity-toggle__text { - font-size: 14px; - -unity-font-style: bold; - margin-left: 5px; -} - -/* Content container styling */ -.tween-content { - margin-left: 5px; - margin-top: 5px; - padding-right: 8px; -} - -/* Easing block styling */ -.options-block { - border-width: 1px; - border-color: #555; - padding: 5px; - padding-right: 6px; - margin: 5px -8px 1px -5px; -} - -/* Make curve and ease height consistent */ -.options-block .unity-base-field { +.mie-nested-block .unity-base-field { height: 18px; } -/* Fixing inconsistent flex between Property fields and typed one */ -.tween-block .unity-base-field__label { - flex-basis: 0; - flex-grow: 0; - flex-shrink: 0; - width: 150px; -} -.unity-property-field .unity-base-field__input { - margin-left: 12px; +.mie-block > .message-box { + margin-top: 0; + min-width: 0; + overflow: hidden; + flex-wrap: nowrap; } -/* Message box styling */ -.message-box { - border-width: 1px; - border-color: #555; - padding: 5px; - display: flex; - flex-direction: row; - align-items: center; - margin-bottom: 5px; -} -.message-icon { - width: 16px; - height: 16px; - background-image: resource("icons/console.warnicon.png"); - margin-right: 5px; - flex-shrink: 0; -} -.message-box-label { +.mie-block > .message-box > .message-box-label { + padding-right: 4px; + width: 0; + min-width: 0; flex-grow: 1; - flex-wrap: wrap; + flex-shrink: 1; + white-space: normal; overflow: hidden; - padding-right: 8px; - text-overflow: ellipsis; - -unity-overflow-clip-box: padding-box; + text-overflow: clip; } + .add-component-button { flex-grow: 0; flex-shrink: 0; height: 18px; - margin: 0; + margin: 0 0 0 2px; padding: 0 6px; - border-width: 1px; - border-color: #555; - background-color: #333; - color: #fff; font-size: 11px; -} -.add-component-button:hover { - background-color: #444; -} -.add-component-button:active { - background-color: #555; + align-self: center; } -/* Button styling */ .buttons-row { flex-direction: row; justify-content: space-between; @@ -112,11 +39,7 @@ margin-right: -3px; } -.button { - border-width: 1px; - border-color: #555; - background-color: #333; - color: #fff; +.buttons-row .mie-button { height: 22px; -unity-background-scale-mode: scale-to-fit; background-size: 16px 16px; @@ -125,13 +48,6 @@ flex-grow: 1; } -.button:hover { - background-color: #444; -} -.button:active { - background-color: #555; -} - .play-button { background-image: resource("d_PlayButton"); } @@ -153,7 +69,6 @@ background-image: resource("d_Refresh"); } -/* Play-mode hover tip (built-in tooltip is off during Play Mode) */ .button-tooltip { position: absolute; background-color: rgba(30, 30, 30, .95); diff --git a/Editor/DOTweenUIControllerEditor.cs b/Editor/DOTweenUIControllerEditor.cs index 7ba538c..aa81b05 100644 --- a/Editor/DOTweenUIControllerEditor.cs +++ b/Editor/DOTweenUIControllerEditor.cs @@ -1,4 +1,5 @@ using System; +using Mane.Unity.Editor; using UnityEditor; using UnityEngine; using UnityEngine.UI; @@ -10,15 +11,10 @@ namespace Mane.Unity.DOTween.Editor { [CustomEditor(typeof(DOTweenUIController))] - public class DOTweenUIControllerEditor : UnityEditor.Editor + public class DOTweenUIControllerEditor : ManeEditor { - [SerializeField] private VisualTreeAsset xml; - - public override VisualElement CreateInspectorGUI() + protected override void BuildInspector(VisualElement root) { - VisualElement root = new(); - xml.CloneTree(root); - // Setup autoplay toggles Toggle restartOnEnableToggle = root.Q("restartOnEnableToggle"); Toggle autoplayToggle = root.Q("autoplayToggle"); @@ -45,9 +41,6 @@ public override VisualElement CreateInspectorGUI() // Play-mode-only controls: built-in VisualElement.tooltip is suppressed in Play Mode SetupEditorButtons(root); - return root; - - void SetMainTogglesVisibility() { restartOnEnableToggle.style.display = autoplayToggle.value ? DisplayStyle.Flex : DisplayStyle.None; @@ -80,33 +73,31 @@ private void SetupTweenData(DOTweenUIController.TweenType tweenType, VisualEleme Debug.LogError($"Toggle 'isEnableToggle' not found in '{elementName}'."); return; } - - // Message box - VisualElement messageBox = tweenDataElement.Q("messageBox"); - if (messageBox == null) - { - Debug.LogError($"VisualElement 'messageBox' not found in '{elementName}'."); - return; - } - + isEnableToggle.text = label; - - // Required component - Button addComponentButton = messageBox.Q