Skip to content

Commit

Permalink
Added new tag in unity tag manager (https://docs.unity3d.com/410/Docu…
Browse files Browse the repository at this point in the history
…mentation/Components/class-TagManager.html) to ensure components on new page or cleaned up correctly when leaving the page.
  • Loading branch information
Quantumrunner committed Apr 4, 2024
1 parent 1d9a598 commit bdece9f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
8 changes: 8 additions & 0 deletions unity/Assets/Scripts/Destroyer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ public static void Destroy()
foreach (GameObject go in GameObject.FindGameObjectsWithTag(Game.QUESTLIST))
Object.Destroy(go);

// Clean up everything marked as 'contentpackui'
foreach (GameObject go in GameObject.FindGameObjectsWithTag(Game.CONTENTPACKUI))
Object.Destroy(go);

// Clean up everything marked as 'contentpacklist'
foreach (GameObject go in GameObject.FindGameObjectsWithTag(Game.CONTENTPACKLIST))
Object.Destroy(go);

// Clean up everything marked as 'editor'
foreach (GameObject go in GameObject.FindGameObjectsWithTag(Game.EDITOR))
Object.Destroy(go);
Expand Down
11 changes: 5 additions & 6 deletions unity/Assets/Scripts/UI/Screens/ContentSelectDownloadScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ private static void CleanUpDialogs()
{
Destroy(go);
}

foreach (GameObject go in GameObject.FindGameObjectsWithTag(Game.CONTENTPACKLIST))
{
Destroy(go);
}
}

private void DrawContentPackList()
Expand Down Expand Up @@ -137,7 +142,6 @@ private void RenderDeleteButton(float offset, KeyValuePair<string, RemoteContent
var ui = new UIElement(scrollArea.GetScrollTransform());
ui.SetBGColor(Color.clear);
ui.SetLocation(UIScaler.GetRight(-6.0f), offset + 1.4f, 1.8f, 1.8f);
//TODO Add new image for delete button
ui.SetImage(button_no_entry);
ui.SetButton(delegate { Delete(contentPack.Value.identifier); });
}
Expand Down Expand Up @@ -233,11 +237,6 @@ private UIElement RenderImage(float offset, KeyValuePair<string, RemoteContentPa
ui.SetBGColor(Color.clear);
if (contentPack.Value.image.Length > 0)
{
//if (game.questsList.quest_list_mode != QuestsManager.QuestListMode.ONLINE)
//{
// DrawPicture(ContentData.FileToTexture(Path.Combine(contentPack.Value., contentPack.Value.image)), ui); ;
//}
//else
if (images_list.IsImageAvailable(contentPack.Value.package_url + contentPack.Value.image))
{
DrawPicture(images_list.GetTexture(contentPack.Value.package_url + contentPack.Value.image), ui);
Expand Down
2 changes: 2 additions & 0 deletions unity/ProjectSettings/TagManager.asset
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ TagManager:
- questlist
- setwindow
- dialogPart
- contentpackui
- contentpacklist
layers:
- Default
- TransparentFX
Expand Down

0 comments on commit bdece9f

Please sign in to comment.