feat(ui): move HSV swatch onto the SV handle
HsvColorPicker: read the color swatch from the SV handle's child
("Handle/Swatch") instead of a standalone root child; drop the dead
leftover-alpha bar and root-swatch fallback handling.
PaintHudPanel.prefab: restructure the picker so the swatch lives under
the SV handle and wire _swatch accordingly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
9dfac9a24c
commit
e571375cab
2 files changed
+871
-257
No files matched your search
@@ -66,6 +66,12 @@ public class HsvColorPicker : MonoBehaviour
|
||||
|
||||
_svHandle = sv.Find("Handle") as RectTransform;
|
||||
|
||||
if (_svHandle)
|
||||
{
|
||||
var swatch = _svHandle.Find("Swatch");
|
||||
if (swatch) _swatch = swatch.GetComponent<Image>();
|
||||
}
|
||||
|
||||
Rehook(sv, OnSvPicked);
|
||||
}
|
||||
|
||||
@@ -78,14 +84,6 @@ public class HsvColorPicker : MonoBehaviour
|
||||
Rehook(hue, OnHuePicked);
|
||||
}
|
||||
|
||||
// Alpha now lives on a standalone slider (PaintHud), not in the picker. Hide any alpha bar a
|
||||
// pre-split prefab still carries so it does not show as a dead, non-functional strip.
|
||||
var leftoverAlpha = transform.Find("Alpha");
|
||||
if (leftoverAlpha) leftoverAlpha.gameObject.SetActive(false);
|
||||
|
||||
var swatch = transform.Find("Swatch");
|
||||
if (swatch) _swatch = swatch.GetComponent<Image>();
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user