mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-12 23:37:07 +00:00
only enable main menu canvas in startup scene
This commit is contained in:
parent
8cf1c143df
commit
76aad79d40
2 changed files with 5 additions and 7 deletions
|
@ -689,6 +689,7 @@ MonoBehaviour:
|
|||
spaceAtBottom: 40
|
||||
spaceBetweenButtons: 30
|
||||
openedWindowTextColor: {r: 0, g: 1, b: 0, a: 1}
|
||||
canvas: {fileID: 4580190521452898284}
|
||||
buttonsContainer: {fileID: 8593699161208457630}
|
||||
buttonPrefab: {fileID: 9144763033384219215, guid: c5e7e3e4ef714514090db34e6278e452,
|
||||
type: 3}
|
||||
|
|
|
@ -21,6 +21,7 @@ namespace SanAndreasUnity.UI
|
|||
|
||||
static MenuEntry s_rootMenuEntry = new MenuEntry();
|
||||
|
||||
public Canvas canvas;
|
||||
public RectTransform buttonsContainer;
|
||||
public GameObject buttonPrefab;
|
||||
|
||||
|
@ -36,16 +37,12 @@ namespace SanAndreasUnity.UI
|
|||
clickAction = () => GameManager.ExitApplication() });
|
||||
}
|
||||
|
||||
void OnGUI ()
|
||||
void OnSceneChanged(SceneChangedMessage sceneChangedMessage)
|
||||
{
|
||||
if (!GameManager.IsInStartupScene)
|
||||
return;
|
||||
|
||||
// draw main menu gui
|
||||
|
||||
|
||||
this.canvas.enabled = GameManager.IsInStartupScene;
|
||||
}
|
||||
|
||||
|
||||
public static bool DrawMenuEntry(string text)
|
||||
{
|
||||
return GUIUtils.ButtonWithCalculatedSize(text, Instance.minButtonWidth, Instance.minButtonHeight);
|
||||
|
|
Loading…
Reference in a new issue