Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit eb7e80d

Browse files
committed
Make sure Mouse Inspect dropdown list gets destroyed after option chosen
1 parent a54888a commit eb7e80d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/UI/Inspectors/InspectUnderMouse.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,12 @@ public static void OnDropdownSelect(int index)
6464
internal static Camera MainCamera;
6565
internal static GraphicRaycaster[] graphicRaycasters;
6666

67-
6867
public void StartInspect(MouseInspectMode mode)
6968
{
7069
MainCamera = Camera.main;
7170
if (!MainCamera)
72-
return;
73-
71+
return;
72+
7473
PanelDragger.ForceEnd();
7574

7675
Mode = mode;
@@ -94,8 +93,14 @@ internal void ClearHitData()
9493
public void StopInspect()
9594
{
9695
Inspecting = false;
96+
9797
UIManager.NavBarRect.gameObject.SetActive(true);
98-
UIManager.PanelHolder.SetActive(true);
98+
UIManager.PanelHolder.SetActive(true);
99+
100+
var drop = UIManager.MouseInspectDropdown;
101+
if (drop.transform.Find("Dropdown List") is Transform list)
102+
drop.DestroyDropdownList(list.gameObject);
103+
99104
UIRoot.SetActive(false);
100105

101106
if (Mode == MouseInspectMode.UI)

0 commit comments

Comments
 (0)