Skip to content

Bind the visual properties left half-covered - #239

Draft
VPDPersonal wants to merge 1 commit into
feat/scene-and-rect-propertiesfrom
feat/visual-properties
Draft

Bind the visual properties left half-covered#239
VPDPersonal wants to merge 1 commit into
feat/scene-and-rect-propertiesfrom
feat/visual-properties

Conversation

@VPDPersonal

Copy link
Copy Markdown
Owner

📚 Stacked on #238#237#236#235#234#233#232#231#230#229 → … → #137.

Summary

Twelve families on components the package bound only in part:

Component Was bound Was not
Image fillAmount, sprite, color type, preserveAspect, fillOrigin, fillClockwise
RawImage texture uvRect
LineRenderer colours widthMultiplier, loop
Renderer SpriteRenderer.sortingOrder Renderer.sortingOrder, sortingLayerName, shadowCastingMode
Selectable colors, interactable transition, targetGraphic

A cooldown could be driven and not shaped; a sprite's draw order could be set and a line's could not.

The guards

  • sortingLayerName refuses a name no layer has, with an error. Unity ignores it silently and leaves the object where it was — which looks exactly like a depth bug.
  • uvRect refuses a non-finite component: the quad's UVs come from those four numbers and one NaN makes the image vanish.
  • widthMultiplier is clamped non-negative, and scales the authored width curve rather than replacing it, so a taper keeps its shape.
  • targetGraphic is on the object base from Add the property bases three value types were missing #230 — a destroyed graphic leaves the control untinted rather than pointing at something that no longer exists.

One deliberate omission

Selectable.spriteState is left out. It is a struct of four sprites, and binding it as one value would replace all four whenever one changes.

Verification

Nine tests. Recompile clean, EditMode 713.

🇷🇺 Описание на русском

📚 Стек: поверх #238#237#236#235#234#233#232#231#230#229 → … → #137.

Кратко

Двенадцать семейств на компонентах, привязанных лишь наполовину:

Компонент Было привязано Не было
Image fillAmount, sprite, color type, preserveAspect, fillOrigin, fillClockwise
RawImage texture uvRect
LineRenderer цвета widthMultiplier, loop
Renderer SpriteRenderer.sortingOrder Renderer.sortingOrder, sortingLayerName, shadowCastingMode
Selectable colors, interactable transition, targetGraphic

Кулдаун можно было двигать, но не задать ему форму; порядок отрисовки спрайта — выставить, а линии — нет.

Гарды

  • sortingLayerName отвергает имя, которого нет ни у одного слоя, с ошибкой. Unity игнорирует его молча и оставляет объект на месте — выглядит в точности как баг с глубиной.
  • uvRect отвергает нефинитную компоненту: UV квада считаются из этих четырёх чисел, и один NaN убирает изображение.
  • widthMultiplier обрезается неотрицательным и масштабирует авторскую кривую ширины, а не заменяет её, — сужение к концу сохраняется.
  • targetGraphic стоит на object-базе из Add the property bases three value types were missing #230: уничтоженный graphic оставляет контрол без подсветки, а не ссылкой на то, чего больше нет.

Одно осознанное исключение

Selectable.spriteState не привязан. Это структура из четырёх спрайтов, и привязка её как одного значения заменяла бы все четыре при изменении одного.

Проверка

Девять тестов. Компиляция чистая, EditMode 713.

Twelve families on components the package already bound in part.

Image type, preserveAspect, fillOrigin and fillClockwise. fillAmount was
bound and the four options that decide what a fill looks like were not,
so a cooldown could be driven and not shaped.

RawImage.uvRect - which part of the texture is shown and how often it
repeats. The component had no binder beyond its texture, and this is the
property a scrolling background or a sprite sheet frame needs. A
non-finite component is refused: the quad's UVs come from these four
numbers and one NaN makes the image vanish.

LineRenderer widthMultiplier and loop. The multiplier scales the authored
width curve rather than replacing it, so a taper keeps its shape;
clamped non-negative.

Renderer sortingOrder, sortingLayerName and shadowCastingMode.
SpriteRenderer's order was bound and the same property inherited from
Renderer was not, so a line, a mesh or a trail could not be brought to the
front. A sorting layer name no layer has is refused with an error: Unity
ignores it silently and leaves the object where it was, which looks
exactly like a depth bug.

Selectable transition and targetGraphic. The colours were bound and the
switch that decides whether they are used at all was not. targetGraphic is
on the object base, so a destroyed graphic leaves the control untinted
rather than pointing at something that no longer exists.

Selectable.spriteState is deliberately left out: it is a struct of four
sprites, and binding it as one value would replace all four whenever one
changes.

Tests: nine.

Verification: recompile clean, EditMode 713.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant