Skip to content

Commit 94aee60

Browse files
authored
[SDK-721] Add clearing of panel switcher (#194)
## [SDK-721](https://ready-player-me.atlassian.net/browse/SDK-721) ## Description - Added clear functionality in panel switcher, which will be called on OnDestroy
1 parent 714e580 commit 94aee60

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Samples~/AvatarCreatorSamples/LegacyAvatarCreator/Scripts/UI/CategoryUICreator.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ private void OnDisable()
4848
outfitCategoryButton.RemoveListener();
4949
}
5050

51+
private void OnDestroy()
52+
{
53+
PanelSwitcher.Clear();
54+
}
55+
5156
private void Initialize()
5257
{
5358
categoryButtonsMap = new Dictionary<AssetType, CategoryButton>();

Samples~/AvatarCreatorSamples/LegacyAvatarCreator/Scripts/UI/PanelSwitcher.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ public static void Switch(AssetType category)
6464
}
6565
}
6666

67+
public static void Clear()
68+
{
69+
CategoryPanelMap?.Clear();
70+
}
71+
6772
private static void DisableAllPanels()
6873
{
6974
foreach (var panels in CategoryPanelMap)

0 commit comments

Comments
 (0)