Fullscreen mode dropdown
This commit is contained in:
parent
c7c2d51262
commit
081f9ff086
File diff suppressed because it is too large
Load Diff
@ -541,6 +541,14 @@ PrefabInstance:
|
|||||||
propertyPath: eventSystem
|
propertyPath: eventSystem
|
||||||
value:
|
value:
|
||||||
objectReference: {fileID: 775644865}
|
objectReference: {fileID: 775644865}
|
||||||
|
- target: {fileID: 2702070852302166608, guid: 7671830e57aa4bd4cab63b8399c6f825, type: 3}
|
||||||
|
propertyPath: m_text
|
||||||
|
value: Windowed
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3281526541317417273, guid: 7671830e57aa4bd4cab63b8399c6f825, type: 3}
|
||||||
|
propertyPath: m_IsActive
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4394421820928219480, guid: 7671830e57aa4bd4cab63b8399c6f825, type: 3}
|
- target: {fileID: 4394421820928219480, guid: 7671830e57aa4bd4cab63b8399c6f825, type: 3}
|
||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: MainMenu
|
value: MainMenu
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using NaughtyAttributes;
|
using NaughtyAttributes;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
|
using UnityEngine.UI;
|
||||||
using Random = UnityEngine.Random;
|
using Random = UnityEngine.Random;
|
||||||
|
|
||||||
public class MainMenuManager : MonoBehaviour {
|
public class MainMenuManager : MonoBehaviour {
|
||||||
@ -15,17 +17,27 @@ public class MainMenuManager : MonoBehaviour {
|
|||||||
|
|
||||||
[SerializeField] [Required]
|
[SerializeField] [Required]
|
||||||
TMP_Text titleLabel;
|
TMP_Text titleLabel;
|
||||||
|
|
||||||
[SerializeField] string[] titleOptions;
|
[SerializeField] string[] titleOptions;
|
||||||
|
|
||||||
[SerializeField] [Required]
|
[SerializeField] [Required]
|
||||||
Transform startMenuParent;
|
Transform startMenuParent;
|
||||||
|
|
||||||
[SerializeField] [Required]
|
[SerializeField] [Required]
|
||||||
Transform pauseParent;
|
Transform pauseParent;
|
||||||
|
|
||||||
[SerializeField] [Required]
|
[SerializeField] [Required]
|
||||||
Transform optionsParent;
|
Transform optionsParent;
|
||||||
|
|
||||||
[SerializeField] [Required]
|
[SerializeField] [Required]
|
||||||
GameTimer gameTimer;
|
GameTimer gameTimer;
|
||||||
|
|
||||||
[SerializeField] [Required]
|
[SerializeField] [Required]
|
||||||
EventSystem eventSystem;
|
EventSystem eventSystem;
|
||||||
|
|
||||||
|
[SerializeField] [Required]
|
||||||
|
TMP_Dropdown displayModeDropdown;
|
||||||
|
|
||||||
MenuMode mode;
|
MenuMode mode;
|
||||||
MenuMode? preOptionsMode;
|
MenuMode? preOptionsMode;
|
||||||
|
|
||||||
@ -83,4 +95,13 @@ public class MainMenuManager : MonoBehaviour {
|
|||||||
public void QuitGame() => Application.Quit(0);
|
public void QuitGame() => Application.Quit(0);
|
||||||
|
|
||||||
public void ResetHighScore() => gameTimer.ResetHighScore();
|
public void ResetHighScore() => gameTimer.ResetHighScore();
|
||||||
|
|
||||||
|
public void DisplayModeChange() {
|
||||||
|
Screen.fullScreenMode = displayModeDropdown.value switch {
|
||||||
|
0 => FullScreenMode.Windowed,
|
||||||
|
1 => FullScreenMode.ExclusiveFullScreen,
|
||||||
|
2 => FullScreenMode.FullScreenWindow,
|
||||||
|
_ => Screen.fullScreenMode
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user