Sync HUD and enable all paint channels on pipette pick
After a successful pipette pick the painter now enables all four paint channels (albedo, metallic/smoothness, occlusion, emission) and raises a Picked event. The HUD subscribes and re-syncs every widget (toggles, sliders, both colour pickers) to the adopted brush values. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
24a36c0e61
commit
3df855597a
2 files changed
+73
No files matched your search
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public partial class MeshPainter
|
||||
@@ -18,6 +19,12 @@ public partial class MeshPainter
|
||||
"(all alphas set to 1) instead of painting. Held button picks only once.")]
|
||||
public bool pipette = false;
|
||||
|
||||
/// <summary>
|
||||
/// Raised after a successful pick, once the brush has adopted the sampled values and all four
|
||||
/// paint-channel flags have been enabled. The in-game HUD listens to re-sync its widgets.
|
||||
/// </summary>
|
||||
public event Action Picked;
|
||||
|
||||
private bool _pickHeld; // edge tracking so a held button picks once, not every frame
|
||||
|
||||
/// <summary>
|
||||
@@ -67,5 +74,14 @@ public partial class MeshPainter
|
||||
// "Set all alpha values to 1": full-strength adoption across every opacity control.
|
||||
metallicSmoothnessOpacity = 1f;
|
||||
occlusionOpacity = 1f;
|
||||
|
||||
// Picking a whole material implies repainting all of it, so enable every channel.
|
||||
paintAlbedo = true;
|
||||
paintMetallicSmoothness = true;
|
||||
paintOcclusion = true;
|
||||
paintEmission = true;
|
||||
|
||||
// Let listeners (the in-game HUD) refresh their widgets to the adopted values + flags.
|
||||
Picked?.Invoke();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user