fix(ShaderBake): 点选别的格子后 UV X/Y 输入框不跟着换

这两个框只在 SyncUiFromSettings 里同步,而点选走的是 RefreshFaceUi,
于是选中框、编号都换到新格子了,右边还停在上一格(或刚加的那一格)的数值上。
RefreshFaceUi 里补一次 SetValueWithoutNotify。
This commit is contained in:
2026-11-07 10:22:19 +08:00
parent 06d5604526
commit afef2fcb67
@@ -769,9 +769,22 @@ namespace XericUI.ShaderBake.Editor
: "第 " + (m_SelectedFace + 1) + " 格 · UV (" + cell.uvX + ", " + cell.uvY + ")";
}
SetFaceFieldsEnabled(!meshMode);
// 两个 UV 输入框绑的是"当前选中格",换格就得跟着换;
// 它们只在 SyncUiFromSettings 里同步,点选走的是这条路径,不补这一句就一直停在旧格上
SetFaceUvFields(cell);
UpdateFaceOverlay();
}
private void SetFaceUvFields(ShaderBakeFaceCell cell)
{
int uvX = cell != null ? cell.uvX : 0;
int uvY = cell != null ? cell.uvY : 0;
var x = rootVisualElement.Q<VisualElement>("face-uv-x") as INotifyValueChanged<int>;
if (x != null) x.SetValueWithoutNotify(uvX);
var y = rootVisualElement.Q<VisualElement>("face-uv-y") as INotifyValueChanged<int>;
if (y != null) y.SetValueWithoutNotify(uvY);
}
private void SetFaceFieldsEnabled(bool enabled)
{
VisualElement x = rootVisualElement.Q<VisualElement>("face-uv-x");