This repository was archived by the owner on May 9, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
+ using System . Collections ;
2
3
using System . Collections . Generic ;
3
4
using System . Linq ;
4
5
using System . Text ;
5
6
using UnityEngine ;
6
7
using UnityExplorer . Config ;
8
+ using UniverseLib ;
7
9
using UniverseLib . Input ;
8
10
9
11
namespace UnityExplorer . UI
@@ -57,6 +59,21 @@ public static void SetDisplay(int display)
57
59
}
58
60
canvasCamera . targetDisplay = display ;
59
61
}
62
+
63
+ RuntimeProvider . Instance . StartCoroutine ( FixPanels ( ) ) ;
64
+ }
65
+
66
+ private static IEnumerator FixPanels ( )
67
+ {
68
+ yield return null ;
69
+ yield return null ;
70
+
71
+ foreach ( var panel in UIManager . UIPanels . Values )
72
+ {
73
+ panel . EnsureValidSize ( ) ;
74
+ panel . EnsureValidPosition ( ) ;
75
+ panel . Dragger . OnEndResize ( ) ;
76
+ }
60
77
}
61
78
}
62
79
}
Original file line number Diff line number Diff line change @@ -146,6 +146,8 @@ public void EnsureValidSize()
146
146
Rect . SetSizeWithCurrentAnchors ( RectTransform . Axis . Vertical , MinHeight ) ;
147
147
}
148
148
149
+ public void EnsureValidPosition ( ) => EnsureValidPosition ( this . Rect ) ;
150
+
149
151
public static void EnsureValidPosition ( RectTransform panel )
150
152
{
151
153
var pos = panel . localPosition ;
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ public enum VerticalAnchor
45
45
public static Canvas UICanvas { get ; private set ; }
46
46
47
47
internal static GameObject PanelHolder { get ; private set ; }
48
- private static readonly Dictionary < Panels , UIPanel > UIPanels = new ( ) ;
48
+ internal static readonly Dictionary < Panels , UIPanel > UIPanels = new ( ) ;
49
49
50
50
public static RectTransform NavBarRect ;
51
51
public static GameObject NavbarTabButtonHolder ;
You can’t perform that action at this time.
0 commit comments