refactor(editor): hide default Script row for ComponentTypeSelector#142
Merged
Merged
Conversation
- ComponentTypeSelectorPropertyDrawer hides the sibling m_Script PropertyField in the UIToolkit inspector so type-switching goes only through the selector dropdown; scoped to the owning InspectorElement and re-applied on re-attach. - Docs/changelog/QA (EN+RU): document the hidden Script row and the IMGUI limitation. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ComponentTypeSelectornow hides the Inspector's built-in Script (m_Script) row in the UIToolkit inspector while the selector is present — the type is swapped only through the dropdown, so you can no longer editm_Scriptby hand and bypass the selector.Documentation), CHANGELOG EN/RU (Unreleased → Changed) and a bilingual QA‑checklist item.Notes for review
AttachToPanelEventthe drawer walks up to the owningInspectorElementand hides the siblingPropertyFieldwhosebindingPath == "m_Script"(display: None). Scoped to this component's own inspector (sibling components are untouched) and re-applied on every re-attach (undo / domain reload).OnGUIinspector draws the Script row itself, out of a field-level drawer's reach — not the default in Unity 6. Documented in the drawer XML.Linked issues
Closes ASP-58
🇷🇺 Описание на русском
Кратко
ComponentTypeSelectorтеперь скрывает встроенную строку Script (m_Script) в UIToolkit-инспекторе, пока присутствует селектор — тип меняется только через выпадающий список, так что больше нельзя правитьm_Scriptвручную в обход селектора.Documentation), CHANGELOG EN/RU (Unreleased → Changed) и двуязычный пункт QA-чеклиста.Заметки для ревью
AttachToPanelEventdrawer поднимается к своемуInspectorElementи скрывает соседнийPropertyFieldсbindingPath == "m_Script"(display: None). Ограничено инспектором самого компонента (соседние компоненты не затронуты) и переприменяется при каждом re-attach (undo / перезагрузка домена).OnGUI) рисует строку Script сам, вне досягаемости field-drawer'а — в Unity 6 это не путь по умолчанию. Задокументировано в XML drawer'а.