Skip to content

Commit b47f84b

Browse files
nattb8claude
andcommitted
fix(audience-sample): inject tick label into test-mode and mobile-attribution toggles
Same Unity 2021.3 runtime-panel workaround already applied to the debug toggle: without the injected Label the checked state renders as a plain coloured square with no visible tick. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 33acc8c commit b47f84b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

examples/audience/Assets/SampleApp/Scripts/AudienceSample.UI.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,14 @@ private void BindElements()
187187
// Inject a tick Label — Unity 2021.3 runtime panels render the
188188
// checked state as a plain coloured square otherwise. USS hides
189189
// the tick when unchecked.
190-
var debugCheckmark = _debug.Q<VisualElement>(className: "unity-toggle__checkmark");
191-
if (debugCheckmark != null)
190+
foreach (var toggle in new[] { _debug, _testMode, _enableMobileAttribution })
192191
{
192+
var checkmark = toggle.Q<VisualElement>(className: "unity-toggle__checkmark");
193+
if (checkmark == null) continue;
193194
var tick = new Label("✓");
194195
tick.AddToClassList("debug-tick");
195196
tick.pickingMode = PickingMode.Ignore;
196-
debugCheckmark.Add(tick);
197+
checkmark.Add(tick);
197198
}
198199
_flushInterval = Require<TextField>("flush-interval");
199200
_flushSize = Require<TextField>("flush-size");

0 commit comments

Comments
 (0)