From a7fc12f32f728034f08d5acaaf74d5313a17ed58 Mon Sep 17 00:00:00 2001 From: logonkhi Date: Fri, 6 Feb 2026 19:54:11 +0900 Subject: [PATCH] =?UTF-8?q?Dropdown=20popup=20=EC=8A=A4=ED=83=80=EC=9D=BC?= =?UTF-8?q?=20=EA=B0=80=EC=9D=B4=EB=93=9C=20=EC=A0=81=EC=9A=A9=20=EB=B0=8F?= =?UTF-8?q?=20=EB=8B=A4=EC=A4=91=20=EC=84=A0=ED=83=9D=20Dropdown=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIToolkit/Button/UTKCheckBox.uss | 6 +- .../UIToolkit/Dropdown/UTKDropdown.uss | 110 --- .../UIToolkit/Dropdown/UTKDropdownUss.uss | 211 ++++++ ...pdown.uss.meta => UTKDropdownUss.uss.meta} | 2 +- .../UIToolkit/Dropdown/UTKEnumDropDown.uss | 110 --- .../UIToolkit/Dropdown/UTKEnumDropDownUss.uss | 211 ++++++ ...n.uss.meta => UTKEnumDropDownUss.uss.meta} | 2 +- .../Dropdown/UTKMultiSelectDropdownUss.uss | 214 ++++++ .../UTKMultiSelectDropdownUss.uss.meta | 11 + .../UIToolkit/Input/UTKVector2Field.uss | 6 + .../UIToolkit/Input/UTKVector3Field.uss | 1 + .../Views/UTKBoolPropertyItemView.uxml | 3 +- .../Views/UTKDateRangePropertyItemView.uxml | 17 +- .../Views/UTKDateRangePropertyItemViewUss.uss | 1 + .../UTKDateTimeRangePropertyItemView.uxml | 17 +- .../UTKDateTimeRangePropertyItemViewUss.uss | 1 + .../Views/UTKDropdownPropertyItemViewUss.uss | 2 + .../Views/UTKEnumPropertyItemViewUss.uss | 2 + .../Views/UTKRadioPropertyItemViewUss.uss | 2 +- .../UIToolkit/Style/UTKThemeDark.uss | 1 + .../UIToolkit/Style/UTKThemeLight.uss | 1 + .../UIToolkit/UTKMultiSelectDropdown.unity | 653 ++++++++++++++++++ .../UTKMultiSelectDropdown.unity.meta | 7 + .../UIToolkit/UTKMultiSelectDropdownSample.cs | 593 ++++++++++++++++ .../UTKMultiSelectDropdownSample.cs.meta | 2 + .../UTKMultiSelectDropdownSample.uxml | 97 +++ .../UTKMultiSelectDropdownSample.uxml.meta | 10 + .../UTKMultiSelectDropdownSampleUss.uss | 47 ++ .../UTKMultiSelectDropdownSampleUss.uss.meta | 11 + .../UVC/UIToolkit/Dropdown/UTKDropdown.cs | 413 ++++++++++- .../UVC/UIToolkit/Dropdown/UTKEnumDropDown.cs | 389 ++++++++++- .../Dropdown/UTKMultiSelectDropdown.cs | 610 ++++++++++++++++ .../Dropdown/UTKMultiSelectDropdown.cs.meta | 2 + .../Property/Views/UTKBoolPropertyItemView.cs | 2 +- .../Views/UTKColorPropertyItemView.cs | 2 +- .../Views/UTKColorStatePropertyItemView.cs | 2 +- .../Property/Views/UTKDatePropertyItemView.cs | 2 +- .../Views/UTKDateRangePropertyItemView.cs | 6 +- .../Views/UTKDateTimePropertyItemView.cs | 2 +- .../Views/UTKDateTimeRangePropertyItemView.cs | 6 +- .../Views/UTKFloatPropertyItemView.cs | 2 +- .../Property/Views/UTKIntPropertyItemView.cs | 4 +- .../Views/UTKStringPropertyItemView.cs | 2 +- .../Scripts/UVC/UIToolkit/UTKThemeManager.cs | 8 +- 44 files changed, 3477 insertions(+), 326 deletions(-) delete mode 100644 Assets/Resources/UIToolkit/Dropdown/UTKDropdown.uss create mode 100644 Assets/Resources/UIToolkit/Dropdown/UTKDropdownUss.uss rename Assets/Resources/UIToolkit/Dropdown/{UTKDropdown.uss.meta => UTKDropdownUss.uss.meta} (87%) delete mode 100644 Assets/Resources/UIToolkit/Dropdown/UTKEnumDropDown.uss create mode 100644 Assets/Resources/UIToolkit/Dropdown/UTKEnumDropDownUss.uss rename Assets/Resources/UIToolkit/Dropdown/{UTKEnumDropDown.uss.meta => UTKEnumDropDownUss.uss.meta} (87%) create mode 100644 Assets/Resources/UIToolkit/Dropdown/UTKMultiSelectDropdownUss.uss create mode 100644 Assets/Resources/UIToolkit/Dropdown/UTKMultiSelectDropdownUss.uss.meta create mode 100644 Assets/Sample/UIToolkit/UTKMultiSelectDropdown.unity create mode 100644 Assets/Sample/UIToolkit/UTKMultiSelectDropdown.unity.meta create mode 100644 Assets/Sample/UIToolkit/UTKMultiSelectDropdownSample.cs create mode 100644 Assets/Sample/UIToolkit/UTKMultiSelectDropdownSample.cs.meta create mode 100644 Assets/Sample/UIToolkit/UTKMultiSelectDropdownSample.uxml create mode 100644 Assets/Sample/UIToolkit/UTKMultiSelectDropdownSample.uxml.meta create mode 100644 Assets/Sample/UIToolkit/UTKMultiSelectDropdownSampleUss.uss create mode 100644 Assets/Sample/UIToolkit/UTKMultiSelectDropdownSampleUss.uss.meta create mode 100644 Assets/Scripts/UVC/UIToolkit/Dropdown/UTKMultiSelectDropdown.cs create mode 100644 Assets/Scripts/UVC/UIToolkit/Dropdown/UTKMultiSelectDropdown.cs.meta diff --git a/Assets/Resources/UIToolkit/Button/UTKCheckBox.uss b/Assets/Resources/UIToolkit/Button/UTKCheckBox.uss index 5823c71a..913b5037 100644 --- a/Assets/Resources/UIToolkit/Button/UTKCheckBox.uss +++ b/Assets/Resources/UIToolkit/Button/UTKCheckBox.uss @@ -33,6 +33,7 @@ justify-content: center; transition-duration: var(--anim-fast); transition-property: border-color, background-color; + cursor: resource('UIToolkit/Images/cursor_point_white_32') 14 5; /* 클릭 가능 커서 */ } .utk-checkbox:hover .utk-checkbox__box { @@ -43,6 +44,7 @@ .utk-checkbox--indeterminate .utk-checkbox__box { border-color: var(--color-btn-primary); background-color: var(--color-btn-primary); + cursor: resource('UIToolkit/Images/cursor_point_white_32') 14 5; /* 클릭 가능 커서 */ } /* =================================== @@ -53,7 +55,7 @@ width: 14px; height: 14px; font-size: 12px; - color: var(--color-text-on-primary); + color: var(--color-base-01); -unity-text-align: middle-center; -unity-font-style: bold; opacity: 0; @@ -65,6 +67,7 @@ left: 50%; top: 50%; translate: -50% -50%; + cursor: resource('UIToolkit/Images/cursor_point_white_32') 14 5; /* 클릭 가능 커서 */ } .utk-checkbox--checked .utk-checkbox__icon, @@ -80,6 +83,7 @@ margin-left: var(--space-m); font-size: var(--font-size-body2); color: var(--color-text-primary); + cursor: resource('UIToolkit/Images/cursor_point_white_32') 14 5; /* 클릭 가능 커서 */ } /* =================================== diff --git a/Assets/Resources/UIToolkit/Dropdown/UTKDropdown.uss b/Assets/Resources/UIToolkit/Dropdown/UTKDropdown.uss deleted file mode 100644 index d578f419..00000000 --- a/Assets/Resources/UIToolkit/Dropdown/UTKDropdown.uss +++ /dev/null @@ -1,110 +0,0 @@ -/* - * =================================== - * UTKDropdown.uss - * Unity DropdownField 래핑 스타일 - * =================================== - */ - -/* =================================== - Base Container - =================================== */ - -.utk-dropdown { - flex-direction: row; - align-items: center; -} - -/* =================================== - Label - =================================== */ - -.utk-dropdown > .unity-label { - min-width: 60px; - margin-right: var(--space-m); - font-size: var(--font-size-body2); - color: var(--color-text-primary); -} - -/* =================================== - Dropdown Input (Button) - =================================== */ - -.utk-dropdown > .unity-popup-field__input { - flex-direction: row; - align-items: center; - justify-content: space-between; - min-width: 120px; - height: var(--size-input-height); - padding-top: 0px; - padding-bottom: 0px; - padding-left: var(--space-m); - padding-right: var(--space-m); - background-color: var(--color-bg-input); - border-width: var(--border-width); - border-color: var(--color-border); - border-radius: var(--radius-s); - cursor: resource('UIToolkit/Images/cursor_point_white_32') 14 5; - transition-duration: var(--anim-fast); - transition-property: border-color, background-color; -} - -.utk-dropdown > .unity-popup-field__input:hover { - border-color: var(--color-btn-primary); -} - -.utk-dropdown:focus > .unity-popup-field__input { - border-color: var(--color-border-focus); -} - -/* =================================== - Selected Text - =================================== */ - -.utk-dropdown .unity-text-element { - flex-grow: 1; - font-size: var(--font-size-body2); - color: var(--color-text-primary); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -/* =================================== - Arrow Icon - =================================== */ - -.utk-dropdown .unity-base-popup-field__arrow { - width: 10px; - height: 8px; - -unity-background-image-tint-color: var(--color-text-secondary); - margin-left: var(--space-s); -} - -/* =================================== - Disabled State - =================================== */ - -.utk-dropdown--disabled { - cursor: arrow; -} - -.utk-dropdown--disabled > .unity-popup-field__input { - background-color: var(--color-btn-disabled); - cursor: arrow; -} - -.utk-dropdown--disabled > .unity-popup-field__input:hover { - border-color: var(--color-border); -} - -.utk-dropdown--disabled .unity-text-element { - color: var(--color-text-disabled); -} - -.utk-dropdown--disabled .unity-base-popup-field__arrow { - -unity-background-image-tint-color: var(--color-text-disabled); -} - -.utk-dropdown--disabled > .unity-label { - color: var(--color-text-disabled); -} diff --git a/Assets/Resources/UIToolkit/Dropdown/UTKDropdownUss.uss b/Assets/Resources/UIToolkit/Dropdown/UTKDropdownUss.uss new file mode 100644 index 00000000..4dde602c --- /dev/null +++ b/Assets/Resources/UIToolkit/Dropdown/UTKDropdownUss.uss @@ -0,0 +1,211 @@ +/* + * =================================== + * UTKDropdown.uss + * 단일 선택 드롭다운 스타일 + * =================================== + */ + +/* =================================== + Base Container + =================================== */ + +.utk-dropdown { + flex-direction: row; + align-items: center; + position: relative; + overflow: visible; +} + +/* =================================== + Label + =================================== */ + +.utk-dropdown__label { + min-width: 60px; + margin-right: var(--space-m); + font-size: var(--font-size-body2); + color: var(--color-text-primary); + -unity-font-style: normal; +} + +/* =================================== + Input Container (Display Field) + =================================== */ + +.utk-dropdown__input { + flex-direction: row; + align-items: center; + justify-content: space-between; + min-width: 120px; + flex-grow: 1; + height: var(--size-input-height); + padding-top: 0px; + padding-bottom: 0px; + padding-left: var(--space-m); + padding-right: 0; + background-color: var(--color-bg-input); + border-width: var(--border-width); + border-color: var(--color-border); + border-radius: var(--radius-s); + cursor: resource('UIToolkit/Images/cursor_point_white_32') 14 5; + transition-duration: var(--anim-fast); + transition-property: border-color, background-color; +} + +.utk-dropdown__input:hover { + border-color: var(--color-btn-primary); +} + +.utk-dropdown--open .utk-dropdown__input { + border-color: var(--color-border-focus); +} + +/* =================================== + Display Label + =================================== */ + +.utk-dropdown__display { + flex-grow: 1; + flex-shrink: 1; + min-width: 0; + font-size: var(--font-size-body2); + color: var(--color-text-primary); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + -unity-text-align: middle-left; +} + +.utk-dropdown__display--placeholder { + color: var(--color-text-secondary); +} + +/* =================================== + Dropdown Icon Container + =================================== */ + +.utk-dropdown__icon-container { + flex-shrink: 0; + width: 24px; + height: 24px; + margin-left: var(--space-s); + margin-right: 0; + align-items: center; + justify-content: center; +} + +/* =================================== + Dropdown Icon + =================================== */ + +.utk-dropdown__icon { + width: 100%; + height: 100%; + font-size: 18px; + color: var(--color-text-secondary); + -unity-text-align: middle-center; +} + +/* =================================== + Popup Container + =================================== */ + +.utk-dropdown__popup { + max-height: 300px; + background-color: var(--color-bg-elevated); + border-width: var(--border-width); + border-color: var(--color-border); + border-radius: var(--radius-s); + padding: var(--space-xs); + box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); +} + +/* =================================== + Options ScrollView + =================================== */ + +.utk-dropdown__options { + max-height: 280px; +} + +.utk-dropdown__options > .unity-scroll-view__content-container { + flex-direction: column; +} + +/* =================================== + Option Item + =================================== */ + +.utk-dropdown__option { + position: relative; + flex-direction: row; + align-items: center; + padding: var(--space-xs) var(--space-s); + padding-left: 36px; /* 체크 아이콘 공간 확보: 8px(padding) + 20px(icon) + 8px(gap) */ + border-radius: var(--radius-s); + transition-duration: var(--anim-fast); + transition-property: background-color; + cursor: resource('UIToolkit/Images/cursor_point_white_32') 14 5; +} + +.utk-dropdown__option:hover, +.utk-dropdown__option--hover { + background-color: var(--color-bg-hover); +} + +/* =================================== + Check Icon (Selected Indicator) + =================================== */ + +.utk-dropdown__check-icon { + position: absolute; + left: 8px; + width: 20px; + height: 20px; + font-size: 16px; + color: var(--color-btn-primary); + -unity-text-align: middle-center; + cursor: resource('UIToolkit/Images/cursor_point_white_32') 14 5; /* 클릭 가능 커서 */ +} + +/* =================================== + Option Label + =================================== */ + +.utk-dropdown__option-label { + flex-grow: 1; + font-size: var(--font-size-body2); + color: var(--color-text-primary); + margin-left: 0; + padding-left: 0; + cursor: resource('UIToolkit/Images/cursor_point_white_32') 14 5; /* 클릭 가능 커서 */ +} + +/* =================================== + Disabled State + =================================== */ + +.utk-dropdown--disabled { + cursor: arrow; +} + +.utk-dropdown--disabled .utk-dropdown__label { + color: var(--color-text-disabled); +} + +.utk-dropdown--disabled .utk-dropdown__input { + background-color: var(--color-btn-disabled); + cursor: arrow; +} + +.utk-dropdown--disabled .utk-dropdown__input:hover { + border-color: var(--color-border); +} + +.utk-dropdown--disabled .utk-dropdown__display { + color: var(--color-text-disabled); +} + +.utk-dropdown--disabled .utk-dropdown__icon { + color: var(--color-text-disabled); +} diff --git a/Assets/Resources/UIToolkit/Dropdown/UTKDropdown.uss.meta b/Assets/Resources/UIToolkit/Dropdown/UTKDropdownUss.uss.meta similarity index 87% rename from Assets/Resources/UIToolkit/Dropdown/UTKDropdown.uss.meta rename to Assets/Resources/UIToolkit/Dropdown/UTKDropdownUss.uss.meta index b1d8ea14..57ee9c59 100644 --- a/Assets/Resources/UIToolkit/Dropdown/UTKDropdown.uss.meta +++ b/Assets/Resources/UIToolkit/Dropdown/UTKDropdownUss.uss.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 11125bf6e9398df479a3ca01d6b286a9 +guid: 2320c89b336d59c45b16b935c4f311b4 ScriptedImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Resources/UIToolkit/Dropdown/UTKEnumDropDown.uss b/Assets/Resources/UIToolkit/Dropdown/UTKEnumDropDown.uss deleted file mode 100644 index 0ecaff9f..00000000 --- a/Assets/Resources/UIToolkit/Dropdown/UTKEnumDropDown.uss +++ /dev/null @@ -1,110 +0,0 @@ -/* - * =================================== - * UTKEnumDropDown.uss - * Unity EnumField 래핑 스타일 - * =================================== - */ - -/* =================================== - Base Container - =================================== */ - -.utk-enum-dropdown { - flex-direction: row; - align-items: center; -} - -/* =================================== - Label - =================================== */ - -.utk-enum-dropdown > .unity-label { - min-width: 60px; - margin-right: var(--space-m); - font-size: var(--font-size-body2); - color: var(--color-text-primary); -} - -/* =================================== - Dropdown Input (Button) - =================================== */ - -.utk-enum-dropdown > .unity-enum-field__input { - flex-direction: row; - align-items: center; - justify-content: space-between; - min-width: 120px; - height: var(--size-input-height); - padding-top: 0px; - padding-bottom: 0px; - padding-left: var(--space-m); - padding-right: var(--space-m); - background-color: var(--color-bg-input); - border-width: var(--border-width); - border-color: var(--color-border); - border-radius: var(--radius-s); - cursor: resource('UIToolkit/Images/cursor_point_white_32') 14 5; - transition-duration: var(--anim-fast); - transition-property: border-color, background-color; -} - -.utk-enum-dropdown > .unity-enum-field__input:hover { - border-color: var(--color-btn-primary); -} - -.utk-enum-dropdown:focus > .unity-enum-field__input { - border-color: var(--color-border-focus); -} - -/* =================================== - Selected Text - =================================== */ - -.utk-enum-dropdown .unity-text-element { - flex-grow: 1; - font-size: var(--font-size-body2); - color: var(--color-text-primary); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -/* =================================== - Arrow Icon - =================================== */ - -.utk-enum-dropdown .unity-enum-field__arrow { - width: 10px; - height: 8px; - -unity-background-image-tint-color: var(--color-text-secondary); - margin-left: var(--space-s); -} - -/* =================================== - Disabled State - =================================== */ - -.utk-enum-dropdown--disabled { - cursor: arrow; -} - -.utk-enum-dropdown--disabled > .unity-enum-field__input { - background-color: var(--color-btn-disabled); - cursor: arrow; -} - -.utk-enum-dropdown--disabled > .unity-enum-field__input:hover { - border-color: var(--color-border); -} - -.utk-enum-dropdown--disabled .unity-text-element { - color: var(--color-text-disabled); -} - -.utk-enum-dropdown--disabled .unity-enum-field__arrow { - -unity-background-image-tint-color: var(--color-text-disabled); -} - -.utk-enum-dropdown--disabled > .unity-label { - color: var(--color-text-disabled); -} diff --git a/Assets/Resources/UIToolkit/Dropdown/UTKEnumDropDownUss.uss b/Assets/Resources/UIToolkit/Dropdown/UTKEnumDropDownUss.uss new file mode 100644 index 00000000..367b88e6 --- /dev/null +++ b/Assets/Resources/UIToolkit/Dropdown/UTKEnumDropDownUss.uss @@ -0,0 +1,211 @@ +/* + * =================================== + * UTKEnumDropDown.uss + * Enum 선택 드롭다운 스타일 + * =================================== + */ + +/* =================================== + Base Container + =================================== */ + +.utk-enum-dropdown { + flex-direction: row; + align-items: center; + position: relative; + overflow: visible; +} + +/* =================================== + Label + =================================== */ + +.utk-enum-dropdown__label { + min-width: 60px; + margin-right: var(--space-m); + font-size: var(--font-size-body2); + color: var(--color-text-primary); + -unity-font-style: normal; +} + +/* =================================== + Input Container (Display Field) + =================================== */ + +.utk-enum-dropdown__input { + flex-direction: row; + align-items: center; + justify-content: space-between; + min-width: 120px; + flex-grow: 1; + height: var(--size-input-height); + padding-top: 0px; + padding-bottom: 0px; + padding-left: var(--space-m); + padding-right: 0; + background-color: var(--color-bg-input); + border-width: var(--border-width); + border-color: var(--color-border); + border-radius: var(--radius-s); + cursor: resource('UIToolkit/Images/cursor_point_white_32') 14 5; + transition-duration: var(--anim-fast); + transition-property: border-color, background-color; +} + +.utk-enum-dropdown__input:hover { + border-color: var(--color-btn-primary); +} + +.utk-enum-dropdown--open .utk-enum-dropdown__input { + border-color: var(--color-border-focus); +} + +/* =================================== + Display Label + =================================== */ + +.utk-enum-dropdown__display { + flex-grow: 1; + flex-shrink: 1; + min-width: 0; + font-size: var(--font-size-body2); + color: var(--color-text-primary); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + -unity-text-align: middle-left; +} + +.utk-enum-dropdown__display--placeholder { + color: var(--color-text-secondary); +} + +/* =================================== + Dropdown Icon Container + =================================== */ + +.utk-enum-dropdown__icon-container { + flex-shrink: 0; + width: 24px; + height: 24px; + margin-left: var(--space-s); + margin-right: 0; + align-items: center; + justify-content: center; +} + +/* =================================== + Dropdown Icon + =================================== */ + +.utk-enum-dropdown__icon { + width: 100%; + height: 100%; + font-size: 18px; + color: var(--color-text-secondary); + -unity-text-align: middle-center; +} + +/* =================================== + Popup Container + =================================== */ + +.utk-enum-dropdown__popup { + max-height: 300px; + background-color: var(--color-bg-elevated); + border-width: var(--border-width); + border-color: var(--color-border); + border-radius: var(--radius-s); + padding: var(--space-xs); + box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); +} + +/* =================================== + Options ScrollView + =================================== */ + +.utk-enum-dropdown__options { + max-height: 280px; +} + +.utk-enum-dropdown__options > .unity-scroll-view__content-container { + flex-direction: column; +} + +/* =================================== + Option Item + =================================== */ + +.utk-enum-dropdown__option { + position: relative; + flex-direction: row; + align-items: center; + padding: var(--space-xs) var(--space-s); + padding-left: 36px; /* 체크 아이콘 공간 확보: 8px(padding) + 20px(icon) + 8px(gap) */ + border-radius: var(--radius-s); + transition-duration: var(--anim-fast); + transition-property: background-color; + cursor: resource('UIToolkit/Images/cursor_point_white_32') 14 5; +} + +.utk-enum-dropdown__option:hover, +.utk-enum-dropdown__option--hover { + background-color: var(--color-bg-hover); +} + +/* =================================== + Check Icon (Selected Indicator) + =================================== */ + +.utk-enum-dropdown__check-icon { + position: absolute; + left: 8px; + width: 20px; + height: 20px; + font-size: 16px; + color: var(--color-btn-primary); + -unity-text-align: middle-center; + cursor: resource('UIToolkit/Images/cursor_point_white_32') 14 5; /* 클릭 가능 커서 */ +} + +/* =================================== + Option Label + =================================== */ + +.utk-enum-dropdown__option-label { + flex-grow: 1; + font-size: var(--font-size-body2); + color: var(--color-text-primary); + margin-left: 0; + padding-left: 0; + cursor: resource('UIToolkit/Images/cursor_point_white_32') 14 5; /* 클릭 가능 커서 */ +} + +/* =================================== + Disabled State + =================================== */ + +.utk-enum-dropdown--disabled { + cursor: arrow; +} + +.utk-enum-dropdown--disabled .utk-enum-dropdown__label { + color: var(--color-text-disabled); +} + +.utk-enum-dropdown--disabled .utk-enum-dropdown__input { + background-color: var(--color-btn-disabled); + cursor: arrow; +} + +.utk-enum-dropdown--disabled .utk-enum-dropdown__input:hover { + border-color: var(--color-border); +} + +.utk-enum-dropdown--disabled .utk-enum-dropdown__display { + color: var(--color-text-disabled); +} + +.utk-enum-dropdown--disabled .utk-enum-dropdown__icon { + color: var(--color-text-disabled); +} diff --git a/Assets/Resources/UIToolkit/Dropdown/UTKEnumDropDown.uss.meta b/Assets/Resources/UIToolkit/Dropdown/UTKEnumDropDownUss.uss.meta similarity index 87% rename from Assets/Resources/UIToolkit/Dropdown/UTKEnumDropDown.uss.meta rename to Assets/Resources/UIToolkit/Dropdown/UTKEnumDropDownUss.uss.meta index ad594bc2..f0e07402 100644 --- a/Assets/Resources/UIToolkit/Dropdown/UTKEnumDropDown.uss.meta +++ b/Assets/Resources/UIToolkit/Dropdown/UTKEnumDropDownUss.uss.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 428a9bf8ee8e97946a076de9f9ae9ac2 +guid: 9e84333091e1fc440853703013572ea1 ScriptedImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/Assets/Resources/UIToolkit/Dropdown/UTKMultiSelectDropdownUss.uss b/Assets/Resources/UIToolkit/Dropdown/UTKMultiSelectDropdownUss.uss new file mode 100644 index 00000000..f04766f9 --- /dev/null +++ b/Assets/Resources/UIToolkit/Dropdown/UTKMultiSelectDropdownUss.uss @@ -0,0 +1,214 @@ +/* + * =================================== + * UTKMultiSelectDropdown.uss + * 다중 선택 드롭다운 스타일 + * =================================== + */ + +/* =================================== + Base Container + =================================== */ + +.utk-multiselect-dropdown { + flex-direction: row; + align-items: center; + position: relative; + overflow: visible; +} + +/* =================================== + Label + =================================== */ + +.utk-multiselect-dropdown__label { + min-width: 60px; + margin-right: var(--space-m); + font-size: var(--font-size-body2); + color: var(--color-text-primary); + -unity-font-style: normal; +} + +/* =================================== + Input Container (Display Field) + =================================== */ + +.utk-multiselect-dropdown__input { + flex-direction: row; + align-items: center; + justify-content: space-between; + min-width: 120px; + flex-grow: 1; + height: var(--size-input-height); + padding-top: 0px; + padding-bottom: 0px; + padding-left: var(--space-m); + padding-right: 0; + background-color: var(--color-bg-input); + border-width: var(--border-width); + border-color: var(--color-border); + border-radius: var(--radius-s); + cursor: resource('UIToolkit/Images/cursor_point_white_32') 14 5; + transition-duration: var(--anim-fast); + transition-property: border-color, background-color; +} + +.utk-multiselect-dropdown__input:hover { + border-color: var(--color-btn-primary); +} + +.utk-multiselect-dropdown--open .utk-multiselect-dropdown__input { + border-color: var(--color-border-focus); +} + +/* =================================== + Display Label + =================================== */ + +.utk-multiselect-dropdown__display { + flex-grow: 1; + flex-shrink: 1; + min-width: 0; + font-size: var(--font-size-body2); + color: var(--color-text-primary); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + -unity-text-align: middle-left; +} + +.utk-multiselect-dropdown__display--placeholder { + color: var(--color-text-secondary); +} + +/* =================================== + Dropdown Icon Container + =================================== */ + +.utk-multiselect-dropdown__icon-container { + flex-shrink: 0; + width: 24px; + height: 24px; + margin-left: var(--space-s); + margin-right: 0; + align-items: center; + justify-content: center; +} + +/* =================================== + Dropdown Icon + =================================== */ + +.utk-multiselect-dropdown__icon { + width: 100%; + height: 100%; + font-size: 18px; + color: var(--color-text-secondary); + -unity-text-align: middle-center; +} + +/* =================================== + Popup Container + =================================== */ + +.utk-multiselect-dropdown__popup { + max-height: 300px; + background-color: var(--color-bg-elevated); + border-width: var(--border-width); + border-color: var(--color-border); + border-radius: var(--radius-s); + padding: var(--space-xs); + box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); +} + +/* =================================== + Options ScrollView + =================================== */ + +.utk-multiselect-dropdown__options { + max-height: 280px; +} + +.utk-multiselect-dropdown__options > .unity-scroll-view__content-container { + flex-direction: column; +} + +/* =================================== + Option Item + =================================== */ + +.utk-multiselect-dropdown__option { + flex-direction: row; + align-items: center; + padding: var(--space-xs) var(--space-s); + border-radius: var(--radius-s); + transition-duration: var(--anim-fast); + transition-property: background-color; +} + +.utk-multiselect-dropdown__option:hover, +.utk-multiselect-dropdown__option--hover { + background-color: var(--color-bg-hover); +} + +/* =================================== + Toggle (Checkbox) + =================================== */ + +.utk-multiselect-dropdown__toggle { + flex-grow: 1; + margin: 0; +} + +.utk-multiselect-dropdown__toggle > .unity-label { + font-size: var(--font-size-body2); + color: var(--color-text-primary); + padding-left: var(--space-s); + flex-grow: 1; +} + +.utk-multiselect-dropdown__toggle > .unity-toggle__input { + flex-shrink: 0; +} + +.utk-multiselect-dropdown__toggle > .unity-toggle__input > .unity-toggle__checkmark { + width: 16px; + height: 16px; + border-width: var(--border-width); + border-color: var(--color-border); + border-radius: var(--radius-xs); + background-color: var(--color-bg-input); +} + +.utk-multiselect-dropdown__toggle:checked > .unity-toggle__input > .unity-toggle__checkmark { + background-color: var(--color-btn-primary); + border-color: var(--color-btn-primary); +} + +/* =================================== + Disabled State + =================================== */ + +.utk-multiselect-dropdown--disabled { + cursor: arrow; +} + +.utk-multiselect-dropdown--disabled .utk-multiselect-dropdown__label { + color: var(--color-text-disabled); +} + +.utk-multiselect-dropdown--disabled .utk-multiselect-dropdown__input { + background-color: var(--color-btn-disabled); + cursor: arrow; +} + +.utk-multiselect-dropdown--disabled .utk-multiselect-dropdown__input:hover { + border-color: var(--color-border); +} + +.utk-multiselect-dropdown--disabled .utk-multiselect-dropdown__display { + color: var(--color-text-disabled); +} + +.utk-multiselect-dropdown--disabled .utk-multiselect-dropdown__icon { + color: var(--color-text-disabled); +} diff --git a/Assets/Resources/UIToolkit/Dropdown/UTKMultiSelectDropdownUss.uss.meta b/Assets/Resources/UIToolkit/Dropdown/UTKMultiSelectDropdownUss.uss.meta new file mode 100644 index 00000000..7c074928 --- /dev/null +++ b/Assets/Resources/UIToolkit/Dropdown/UTKMultiSelectDropdownUss.uss.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ac92d6de4f479c345969f036e1e56cf2 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} + disableValidation: 0 diff --git a/Assets/Resources/UIToolkit/Input/UTKVector2Field.uss b/Assets/Resources/UIToolkit/Input/UTKVector2Field.uss index 23f91d90..7c8e6eee 100644 --- a/Assets/Resources/UIToolkit/Input/UTKVector2Field.uss +++ b/Assets/Resources/UIToolkit/Input/UTKVector2Field.uss @@ -12,6 +12,7 @@ .utk-vector2-field { flex-direction: row; align-items: center; + margin-right: 0; } /* =================================== @@ -56,6 +57,11 @@ margin-right: 0; } +.utk-vector2-field #unity-y-input #unity-text-input { + padding-right: 0; +} + + /* Unity USS does not support :last-child pseudo-class */ /* .utk-vector2-field .unity-float-field:last-child { margin-right: 0; diff --git a/Assets/Resources/UIToolkit/Input/UTKVector3Field.uss b/Assets/Resources/UIToolkit/Input/UTKVector3Field.uss index 3f5b8464..b2e21c9d 100644 --- a/Assets/Resources/UIToolkit/Input/UTKVector3Field.uss +++ b/Assets/Resources/UIToolkit/Input/UTKVector3Field.uss @@ -12,6 +12,7 @@ .utk-vector3-field { flex-direction: row; align-items: center; + margin-right: 0; } /* =================================== diff --git a/Assets/Resources/UIToolkit/Property/Views/UTKBoolPropertyItemView.uxml b/Assets/Resources/UIToolkit/Property/Views/UTKBoolPropertyItemView.uxml index 33a479e8..e7f7eb15 100644 --- a/Assets/Resources/UIToolkit/Property/Views/UTKBoolPropertyItemView.uxml +++ b/Assets/Resources/UIToolkit/Property/Views/UTKBoolPropertyItemView.uxml @@ -1,5 +1,4 @@ - - + diff --git a/Assets/Resources/UIToolkit/Property/Views/UTKDateRangePropertyItemView.uxml b/Assets/Resources/UIToolkit/Property/Views/UTKDateRangePropertyItemView.uxml index e1a13941..07146cba 100644 --- a/Assets/Resources/UIToolkit/Property/Views/UTKDateRangePropertyItemView.uxml +++ b/Assets/Resources/UIToolkit/Property/Views/UTKDateRangePropertyItemView.uxml @@ -1,13 +1,16 @@ - - + - - - + + + + + - - + + + + diff --git a/Assets/Resources/UIToolkit/Property/Views/UTKDateRangePropertyItemViewUss.uss b/Assets/Resources/UIToolkit/Property/Views/UTKDateRangePropertyItemViewUss.uss index d6a402d5..852c48fb 100644 --- a/Assets/Resources/UIToolkit/Property/Views/UTKDateRangePropertyItemViewUss.uss +++ b/Assets/Resources/UIToolkit/Property/Views/UTKDateRangePropertyItemViewUss.uss @@ -19,5 +19,6 @@ .utk-property-item-view--date-range .utk-property-item-view__range-separator { margin: 0 8px; + justify-content: center; -unity-text-align: middle-center; } diff --git a/Assets/Resources/UIToolkit/Property/Views/UTKDateTimeRangePropertyItemView.uxml b/Assets/Resources/UIToolkit/Property/Views/UTKDateTimeRangePropertyItemView.uxml index e1a13941..a6395c05 100644 --- a/Assets/Resources/UIToolkit/Property/Views/UTKDateTimeRangePropertyItemView.uxml +++ b/Assets/Resources/UIToolkit/Property/Views/UTKDateTimeRangePropertyItemView.uxml @@ -1,13 +1,16 @@ - - + - - - + + + + + - - + + + + diff --git a/Assets/Resources/UIToolkit/Property/Views/UTKDateTimeRangePropertyItemViewUss.uss b/Assets/Resources/UIToolkit/Property/Views/UTKDateTimeRangePropertyItemViewUss.uss index c0dae9a3..00c7c0e3 100644 --- a/Assets/Resources/UIToolkit/Property/Views/UTKDateTimeRangePropertyItemViewUss.uss +++ b/Assets/Resources/UIToolkit/Property/Views/UTKDateTimeRangePropertyItemViewUss.uss @@ -19,5 +19,6 @@ .utk-property-item-view--datetime-range .utk-property-item-view__range-separator { margin: 0 8px; + justify-content: center; -unity-text-align: middle-center; } diff --git a/Assets/Resources/UIToolkit/Property/Views/UTKDropdownPropertyItemViewUss.uss b/Assets/Resources/UIToolkit/Property/Views/UTKDropdownPropertyItemViewUss.uss index d1a24ba9..b8897a5c 100644 --- a/Assets/Resources/UIToolkit/Property/Views/UTKDropdownPropertyItemViewUss.uss +++ b/Assets/Resources/UIToolkit/Property/Views/UTKDropdownPropertyItemViewUss.uss @@ -9,4 +9,6 @@ .utk-property-item-view--dropdown .utk-property-item-view__dropdown { flex-grow: 1; + margin-left: 0; + margin-right: 0; } diff --git a/Assets/Resources/UIToolkit/Property/Views/UTKEnumPropertyItemViewUss.uss b/Assets/Resources/UIToolkit/Property/Views/UTKEnumPropertyItemViewUss.uss index 0c6a39d9..b6197a60 100644 --- a/Assets/Resources/UIToolkit/Property/Views/UTKEnumPropertyItemViewUss.uss +++ b/Assets/Resources/UIToolkit/Property/Views/UTKEnumPropertyItemViewUss.uss @@ -9,4 +9,6 @@ .utk-property-item-view--enum .utk-property-item-view__dropdown { flex-grow: 1; + margin-left: 0; + margin-right: 0; } diff --git a/Assets/Resources/UIToolkit/Property/Views/UTKRadioPropertyItemViewUss.uss b/Assets/Resources/UIToolkit/Property/Views/UTKRadioPropertyItemViewUss.uss index bce2804b..0d283976 100644 --- a/Assets/Resources/UIToolkit/Property/Views/UTKRadioPropertyItemViewUss.uss +++ b/Assets/Resources/UIToolkit/Property/Views/UTKRadioPropertyItemViewUss.uss @@ -8,7 +8,7 @@ } .utk-property-item-view--radio .utk-property-item-view__radio-container { - flex-direction: row; + flex-direction: column; flex-wrap: wrap; flex-grow: 1; } diff --git a/Assets/Resources/UIToolkit/Style/UTKThemeDark.uss b/Assets/Resources/UIToolkit/Style/UTKThemeDark.uss index 5650aba9..76d3b5a3 100644 --- a/Assets/Resources/UIToolkit/Style/UTKThemeDark.uss +++ b/Assets/Resources/UIToolkit/Style/UTKThemeDark.uss @@ -141,6 +141,7 @@ --color-bg-modal: var(--color-base-18); --color-bg-panel: var(--color-base-20); --color-bg-input: var(--color-base-19); + --color-bg-hover: var(--color-base-16); --color-bg-tooltip: rgba(38, 38, 38, 0.95); --color-bg-overlay: rgba(0, 0, 0, 0.5); diff --git a/Assets/Resources/UIToolkit/Style/UTKThemeLight.uss b/Assets/Resources/UIToolkit/Style/UTKThemeLight.uss index 08cf45ed..13a1c4f2 100644 --- a/Assets/Resources/UIToolkit/Style/UTKThemeLight.uss +++ b/Assets/Resources/UIToolkit/Style/UTKThemeLight.uss @@ -148,6 +148,7 @@ --color-bg-modal: var(--color-base-02); --color-bg-panel: var(--color-base-01); --color-bg-input: var(--color-base-01); + --color-bg-hover: var(--color-base-04); --color-bg-tooltip: rgba(50, 50, 50, 0.95); --color-bg-overlay: rgba(0, 0, 0, 0.3); diff --git a/Assets/Sample/UIToolkit/UTKMultiSelectDropdown.unity b/Assets/Sample/UIToolkit/UTKMultiSelectDropdown.unity new file mode 100644 index 00000000..afea4bec --- /dev/null +++ b/Assets/Sample/UIToolkit/UTKMultiSelectDropdown.unity @@ -0,0 +1,653 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 1 + m_PVRFilteringGaussRadiusAO: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &1097328750 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1097328752} + - component: {fileID: 1097328754} + - component: {fileID: 1097328755} + m_Layer: 0 + m_Name: Sample + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1097328752 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1097328750} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1097328754 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1097328750} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: UnityEngine.dll::UnityEngine.UIElements.UIDocument + m_PanelSettings: {fileID: 11400000, guid: 5ad7007b08a97b54d927c352279a18b6, type: 2} + m_ParentUI: {fileID: 0} + sourceAsset: {fileID: 9197481963319205126, guid: 7811bd1f07a45124d9706c043c3c1ee6, type: 3} + m_SortingOrder: 0 + m_Position: 0 + m_WorldSpaceSizeMode: 1 + m_WorldSpaceWidth: 1920 + m_WorldSpaceHeight: 1080 + m_PivotReferenceSize: 0 + m_Pivot: 0 + m_WorldSpaceCollider: {fileID: 0} +--- !u!114 &1097328755 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1097328750} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ce8c9286a85a9bd4b8dc349cac435424, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::UTKMultiSelectDropdownSample +--- !u!1 &1192809690 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1192809694} + - component: {fileID: 1192809693} + - component: {fileID: 1192809692} + - component: {fileID: 1192809691} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &1192809691 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1192809690} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 5 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1192809692 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1192809690} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1192809693 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1192809690} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1192809694 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1192809690} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1331954412 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1331954415} + - component: {fileID: 1331954414} + - component: {fileID: 1331954413} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1331954413 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1331954412} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 + m_MoveRepeatDelay: 0.5 + m_MoveRepeatRate: 0.1 + m_XRTrackingOrigin: {fileID: 0} + m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_DeselectOnBackgroundClick: 1 + m_PointerBehavior: 0 + m_CursorLockBehavior: 0 + m_ScrollDeltaPerTick: 6 +--- !u!114 &1331954414 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1331954412} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &1331954415 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1331954412} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1414861612 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1414861614} + - component: {fileID: 1414861613} + - component: {fileID: 1414861615} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &1414861613 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1414861612} + m_Enabled: 1 + serializedVersion: 11 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ForceVisible: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 + m_LightUnit: 1 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 +--- !u!4 &1414861614 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1414861612} + serializedVersion: 2 + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!114 &1414861615 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1414861612} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_CustomShadowLayers: 0 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} + m_SoftShadowQuality: 0 + m_RenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_ShadowRenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_Version: 4 + m_LightLayerMask: 1 + m_ShadowLayerMask: 1 + m_RenderingLayers: 1 + m_ShadowRenderingLayers: 1 +--- !u!1 &2136621999 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2136622002} + - component: {fileID: 2136622001} + - component: {fileID: 2136622000} + - component: {fileID: 2136622003} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &2136622000 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2136621999} + m_Enabled: 1 +--- !u!20 &2136622001 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2136621999} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &2136622002 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2136621999} + serializedVersion: 2 + m_LocalRotation: {x: 0.42261827, y: 0, z: 0, w: 0.9063079} + m_LocalPosition: {x: 0, y: 40, z: -50} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 50, y: 0, z: 0} +--- !u!114 &2136622003 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2136621999} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalAdditionalCameraData + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 + m_Version: 2 +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 2136622002} + - {fileID: 1414861614} + - {fileID: 1331954415} + - {fileID: 1097328752} + - {fileID: 1192809694} diff --git a/Assets/Sample/UIToolkit/UTKMultiSelectDropdown.unity.meta b/Assets/Sample/UIToolkit/UTKMultiSelectDropdown.unity.meta new file mode 100644 index 00000000..ea4c1d0b --- /dev/null +++ b/Assets/Sample/UIToolkit/UTKMultiSelectDropdown.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 32c05d2a3d319574982705435757c865 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sample/UIToolkit/UTKMultiSelectDropdownSample.cs b/Assets/Sample/UIToolkit/UTKMultiSelectDropdownSample.cs new file mode 100644 index 00000000..2debfc91 --- /dev/null +++ b/Assets/Sample/UIToolkit/UTKMultiSelectDropdownSample.cs @@ -0,0 +1,593 @@ +#nullable enable +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UIElements; +using UVC.UIToolkit; + +/// +/// UTKMultiSelectDropdown 컴포넌트 샘플 +/// UXML 파일을 로드하여 쿼리 방식으로 사용하는 예제 +/// +[RequireComponent(typeof(UIDocument))] +public class UTKMultiSelectDropdownSample : MonoBehaviour +{ + #region Enums + /// 게임 난이도 + public enum Difficulty + { + Easy, + Normal, + Hard, + Expert + } + + /// 품질 설정 + public enum QualityLevel + { + Low, + Medium, + High, + Ultra + } + + /// 파일 형식 + public enum FileFormat + { + PNG, + JPG, + GIF, + BMP, + TIFF + } + + /// 정렬 방식 + public enum SortOrder + { + Ascending, + Descending + } + #endregion + + #region Fields + [SerializeField] + [Tooltip("UI를 표시할 UIDocument 컴포넌트")] + public UIDocument? _uiDocument; + + [SerializeField] + [Tooltip("시작 시 적용할 테마")] + private UTKTheme initialTheme = UTKTheme.Dark; + + private UTKToggle _themeToggle; + + private VisualElement? _root; + + // 다중 선택 드롭다운 참조 + private UTKMultiSelectDropdown? _dropdownBasic; + private UTKMultiSelectDropdown? _dropdownDefault; + private UTKMultiSelectDropdown? _dropdownCategory; + private UTKMultiSelectDropdown? _dropdownTag; + private UTKMultiSelectDropdown? _dropdownSelectAll; + private UTKMultiSelectDropdown? _dropdownDisabled; + + // 다중 선택 결과 라벨 참조 + private Label? _resultBasic; + private Label? _resultDefault; + private Label? _resultCategory; + private Label? _resultTag; + private Label? _resultSelectAll; + + // 버튼 참조 + private UTKButton? _btnSelectAll; + private UTKButton? _btnClear; + + // 단일 선택 드롭다운 참조 + private UTKDropdown? _dropdownSingleBasic; + private UTKDropdown? _dropdownSingleDefault; + private UTKDropdown? _dropdownSingleSort; + private UTKDropdown? _dropdownSingleDisabled; + + // 단일 선택 결과 라벨 참조 + private Label? _dropdownResultBasic; + private Label? _dropdownResultDefault; + private Label? _dropdownResultSort; + + // Enum 드롭다운 참조 + private UTKEnumDropDown? _enumDropdownDifficulty; + private UTKEnumDropDown? _enumDropdownQuality; + private UTKEnumDropDown? _enumDropdownFormat; + private UTKEnumDropDown? _enumDropdownDisabled; + + // Enum 결과 라벨 참조 + private Label? _enumResultDifficulty; + private Label? _enumResultQuality; + private Label? _enumResultFormat; + #endregion + + #region Unity Lifecycle + private void Start() + { + var doc = GetComponent(); + if (doc == null) + { + Debug.LogError("UIDocument가 할당되지 않았습니다."); + return; + } + _uiDocument = doc; + + var toggle = _uiDocument.rootVisualElement.Q("toggle"); + if (toggle == null) + { + Debug.LogError("UXML에서 UTKToggle을 찾을 수 없습니다."); + return; + } + _themeToggle = toggle; + + UTKThemeManager.Instance.RegisterRoot(_uiDocument.rootVisualElement); + UTKThemeManager.Instance.SetTheme(initialTheme); + + _themeToggle.OnValueChanged += (isOn) => + { + UTKThemeManager.Instance.SetTheme(!isOn ? UTKTheme.Dark : UTKTheme.Light); + }; + + LoadUIFromUXML(); + } + + private void OnDestroy() + { + UnregisterEvents(); + } + #endregion + + #region Setup + private void LoadUIFromUXML() + { + // UIDocument 참조 확인 + var doc = GetComponent(); + if (doc == null) + { + Debug.LogError("UIDocument가 할당되지 않았습니다."); + return; + } + _uiDocument = doc; + + + // UI 생성 + _root = _uiDocument.rootVisualElement; + + + // 요소 쿼리 + QueryElements(); + + // 초기 설정 + SetupInitialValues(); + + // 이벤트 등록 + RegisterEvents(); + } + + private void QueryElements() + { + if (_root == null) return; + + // 다중 선택 드롭다운 쿼리 + _dropdownBasic = _root.Q("dropdown-basic"); + _dropdownDefault = _root.Q("dropdown-default"); + _dropdownCategory = _root.Q("dropdown-category"); + _dropdownTag = _root.Q("dropdown-tag"); + _dropdownSelectAll = _root.Q("dropdown-selectall"); + _dropdownDisabled = _root.Q("dropdown-disabled"); + + // 다중 선택 결과 라벨 쿼리 + _resultBasic = _root.Q