Force stop panel drag/resize when starting Inspect Under Mouse

This commit is contained in:
Sinai committed 2021-05-15 20:39:29 +10:00
1 parent 83f15c7168
commit cccd02255f
2 files changed
+16 -1

No files matched your search

+2
View File
@@ -71,6 +71,8 @@ namespace UnityExplorer.UI.Inspectors
if (!MainCamera)
return;
PanelDragger.ForceEnd();
Mode = mode;
Inspecting = true;
UIManager.NavBarRect.gameObject.SetActive(false);
+14 -1
View File
@@ -17,6 +17,20 @@ namespace UnityExplorer.UI.Panels
public static bool Resizing { get; private set; }
public static bool ResizePrompting => s_resizeCursorObj && s_resizeCursorObj.activeSelf;
internal static void ForceEnd()
{
s_resizeCursorObj.SetActive(false);
wasAnyDragging = false;
foreach (var instance in Instances)
{
instance.WasDragging = false;
instance.WasResizing = false;
}
}
internal static List<PanelDragger> Instances = new List<PanelDragger>();
static PanelDragger()
@@ -82,7 +96,6 @@ namespace UnityExplorer.UI.Panels
#endregion
public static bool ResizePrompting => s_resizeCursorObj && s_resizeCursorObj.activeSelf;
public static GameObject s_resizeCursorObj;
internal static bool wasAnyDragging;