Skip to content

Commit b829954

Browse files
adding UITK panel prefab to postgamestate DI
1 parent f6db0cc commit b829954

File tree

4 files changed

+38
-52
lines changed

4 files changed

+38
-52
lines changed

Assets/Prefabs/UI/UIToolkit/SettingsPanelCanvasUITK.prefab

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ GameObject:
7676
m_Component:
7777
- component: {fileID: 8673277459071735180}
7878
- component: {fileID: 8607712241056528212}
79-
- component: {fileID: 4923764729715591813}
8079
m_Layer: 5
8180
m_Name: UIQuitPanel
8281
m_TagString: Untagged
@@ -112,19 +111,3 @@ MonoBehaviour:
112111
m_Name:
113112
m_EditorClassIdentifier:
114113
m_QuitMode: 0
115-
--- !u!114 &4923764729715591813
116-
MonoBehaviour:
117-
m_ObjectHideFlags: 0
118-
m_CorrespondingSourceObject: {fileID: 0}
119-
m_PrefabInstance: {fileID: 0}
120-
m_PrefabAsset: {fileID: 0}
121-
m_GameObject: {fileID: 4153888348426691229}
122-
m_Enabled: 1
123-
m_EditorHideFlags: 0
124-
m_Script: {fileID: 11500000, guid: 1b2c62ac3bcd44fb9e09835581422057, type: 3}
125-
m_Name:
126-
m_EditorClassIdentifier:
127-
parentReference:
128-
TypeName: Unity.BossRoom.ApplicationLifecycle.ApplicationController
129-
autoRun: 1
130-
autoInjectGameObjects: []

Assets/Scenes/PostGame.unity

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:9f6d043b0d737b156218d82153c0068bda1b8af7cf40d1acdf13adc7356e6ae8
3-
size 34859
2+
oid sha256:ae9c4812e399a6ce3223651153d72979b7eee23921f506c9a8cfc4cd72d01a91
3+
size 33226
Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,48 @@
1-
using System;
1+
using System;
22
using UnityEngine;
33

4-
namespace Unity.BossRoom.Gameplay.UI
5-
{
4+
namespace Unity.BossRoom.Gameplay.UI
5+
{
66
/// <summary>
77
/// Controls the special Canvas that has the settings icon and the settings window.
88
/// The window itself is controlled by UISettingsPanel; the button is controlled here.
99
/// </summary>
10-
public class OldUISettingsCanvas : MonoBehaviour { [SerializeField] private GameObject m_SettingsPanelRoot;
11-
10+
public class OldUISettingsCanvas : MonoBehaviour
11+
{
1212
[SerializeField]
13-
GameObject m_QuitPanelRoot;
13+
private GameObject m_SettingsPanelRoot;
1414

15-
void Awake()
16-
{
17-
// hide the settings window at startup (this is just to handle the common case where an artist forgets to disable the window in the prefab)
18-
DisablePanels();
19-
}
15+
[SerializeField]
16+
GameObject m_QuitPanelRoot;
2017

21-
void DisablePanels()
22-
{
23-
m_SettingsPanelRoot.SetActive(false);
24-
m_QuitPanelRoot.SetActive(false);
25-
}
18+
void Awake()
19+
{
20+
// hide the settings window at startup (this is just to handle the common case where an artist forgets to disable the window in the prefab)
21+
DisablePanels();
22+
}
2623

27-
/// <summary>
28-
/// Called directly by the settings button in the UI prefab
29-
/// </summary>
30-
public void OnClickSettingsButton()
31-
{
32-
m_SettingsPanelRoot.SetActive(!m_SettingsPanelRoot.activeSelf);
33-
m_QuitPanelRoot.SetActive(false);
34-
}
24+
void DisablePanels()
25+
{
26+
m_SettingsPanelRoot.SetActive(false);
27+
m_QuitPanelRoot.SetActive(false);
28+
}
3529

36-
/// <summary>
37-
/// Called directly by the quit button in the UI prefab
38-
/// </summary>
39-
public void OnClickQuitButton()
40-
{
41-
m_QuitPanelRoot.SetActive(!m_QuitPanelRoot.activeSelf);
42-
m_SettingsPanelRoot.SetActive(false);
30+
/// <summary>
31+
/// Called directly by the settings button in the UI prefab
32+
/// </summary>
33+
public void OnClickSettingsButton()
34+
{
35+
m_SettingsPanelRoot.SetActive(!m_SettingsPanelRoot.activeSelf);
36+
m_QuitPanelRoot.SetActive(false);
37+
}
38+
39+
/// <summary>
40+
/// Called directly by the quit button in the UI prefab
41+
/// </summary>
42+
public void OnClickQuitButton()
43+
{
44+
m_QuitPanelRoot.SetActive(!m_QuitPanelRoot.activeSelf);
45+
m_SettingsPanelRoot.SetActive(false);
46+
}
4347
}
44-
}
4548
}

Assets/Scripts/Gameplay/UI/UISettingsCanvas.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void Awake()
3434
// Retrieve the root VisualElement from the UIDocument
3535
var root = uiDocument.rootVisualElement;
3636
// get UIQuitPanel component which is attached to the same GameObject
37-
uiQuitPanel = GetComponent<UIQuitPanel>();
37+
uiQuitPanel = GetComponentInChildren<UIQuitPanel>();
3838
// Query the panels by their names or assigned USS classes
3939
settingsPanelRoot = root.Q<VisualElement>("settingsPanelRoot");
4040
quitPanelRoot = root.Q<VisualElement>("quitPanelRoot");

0 commit comments

Comments
 (0)