Skip to content

Commit 83e43d3

Browse files
authored
Merge pull request #3990 from Railboy/mrtk_appbar_custom_button
Stops AppBar from changing custom button visibility
2 parents b8f2244 + 43151ce commit 83e43d3

File tree

1 file changed

+21
-4
lines changed
  • Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/AppBar

1 file changed

+21
-4
lines changed

Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/AppBar/AppBar.cs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,16 @@ private void InitializeButtons()
256256
throw new Exception("Found a transform without an AppBarButton component under buttonTransforms!");
257257

258258
appBarButton.InitializeButtonContent(this);
259-
// Set to invisible initially
260-
appBarButton.SetVisible(false);
259+
// Set to invisible initially if not custom
260+
switch (appBarButton.ButtonType)
261+
{
262+
case ButtonTypeEnum.Custom:
263+
break;
264+
265+
default:
266+
appBarButton.SetVisible(false);
267+
break;
268+
}
261269

262270
buttons.Add(appBarButton);
263271
}
@@ -278,11 +286,20 @@ private void UpdateButtons()
278286
{
279287
AppBarButton button = buttons[i];
280288

281-
if (button.ButtonType != ButtonTypeEnum.Custom)
282-
button.SetVisible(GetButtonVisible(button.ButtonType));
289+
switch (button.ButtonType)
290+
{
291+
case ButtonTypeEnum.Custom:
292+
break;
293+
294+
default:
295+
button.SetVisible(GetButtonVisible(button.ButtonType));
296+
break;
297+
}
283298

284299
if (!buttons[i].Visible)
300+
{
285301
continue;
302+
}
286303

287304
activeButtonNum++;
288305
}

0 commit comments

Comments
 (0)