This repository was archived by the owner on Apr 26, 2021. It is now read-only.
File tree 7 files changed +313
-110
lines changed
7 files changed +313
-110
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,15 @@ public class MenuManager : MonoBehaviour {
12
12
Stack < MenuBase > currMenu ;
13
13
14
14
void Start ( ) {
15
+
15
16
currMenu = new Stack < MenuBase > ( ) ;
16
17
currMenu . Push ( Menus [ FirstMenuId ] ) ;
18
+ MenuBase firstMenu = currMenu . Peek ( ) ;
17
19
18
20
TemplateGameManager . Instance . uiinput . SetSelectedButton ( null ) ;
19
21
20
22
foreach ( var menu in Menus ) {
21
- if ( menu != currMenu . Peek ( ) )
23
+ if ( menu != firstMenu )
22
24
menu . Hide ( true ) ;
23
25
24
26
if ( menu . rt . anchorMin == Vector2 . zero && menu . rt . anchorMax == Vector2 . one && menu . rt . pivot . x == 0.5f && menu . rt . pivot . y == 0.5f && ! ( menu is PopupMenuBase ) ) {
@@ -35,7 +37,7 @@ void Start() {
35
37
IEnumerator DelayedShow ( ) {
36
38
yield return null ;
37
39
yield return null ;
38
- currMenu . Peek ( ) . Show ( true ) ;
40
+ firstMenu . Show ( true ) ;
39
41
}
40
42
}
41
43
Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ public class PopupMenuBase : MenuBase {
13
13
14
14
protected bool isShowed = true ;
15
15
16
- private void Start ( ) {
16
+ protected override void Awake ( ) {
17
+ base . Awake ( ) ;
18
+
17
19
RecalcPos ( ) ;
18
20
19
21
cg . interactable = cg . blocksRaycasts = true ;
You can’t perform that action at this time.
0 commit comments