Added help menu
This commit is contained in:
parent
b75c58e5ca
commit
8a2cd99e5c
@ -62381,10 +62381,10 @@ MonoBehaviour:
|
||||
- position: {x: 10, y: -10}
|
||||
direction: {x: 0, y: 1}
|
||||
stats: {fileID: 11400000, guid: fe319ad8c9a37b84e8b45268c913d54c, type: 2}
|
||||
lightGladiator: {fileID: 2004725698506461419, guid: f75821098c495cb43a0bff5d9ef0a671, type: 3}
|
||||
regularGladiator: {fileID: 2004725698506461419, guid: f75821098c495cb43a0bff5d9ef0a671, type: 3}
|
||||
heavyGladiator: {fileID: 1373848176550804357, guid: 99423d7c9a753554e87e6bb7e555018b, type: 3}
|
||||
<gladiatorParent>k__BackingField: {fileID: 793317230}
|
||||
lightGladiator: {fileID: 2004725698506461419, guid: f75821098c495cb43a0bff5d9ef0a671, type: 3}
|
||||
regularGladiator: {fileID: 2004725698506461419, guid: 1c845e33da3769f40a2ef2328fa10ce2, type: 3}
|
||||
heavyGladiator: {fileID: 1373848176550804357, guid: 99423d7c9a753554e87e6bb7e555018b, type: 3}
|
||||
<minionParent>k__BackingField: {fileID: 1787272690}
|
||||
<graveyard>k__BackingField: {fileID: 1550580935}
|
||||
currWaveSize: 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -256,7 +256,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_Mode: 0
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
@ -282,7 +282,7 @@ MonoBehaviour:
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_Interactable: 0
|
||||
m_TargetGraphic: {fileID: 0}
|
||||
m_FillRect: {fileID: 358338754108010580}
|
||||
m_HandleRect: {fileID: 0}
|
||||
|
||||
@ -627,7 +627,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_Mode: 0
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
@ -653,7 +653,7 @@ MonoBehaviour:
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_Interactable: 0
|
||||
m_TargetGraphic: {fileID: 0}
|
||||
m_FillRect: {fileID: 1878107874529155599}
|
||||
m_HandleRect: {fileID: 0}
|
||||
|
||||
@ -13,6 +13,8 @@ public class MainMenuManager : MonoBehaviour {
|
||||
MainMenu,
|
||||
PauseMenu,
|
||||
Options,
|
||||
HowTo,
|
||||
Controls
|
||||
}
|
||||
|
||||
[SerializeField] [Required]
|
||||
@ -31,6 +33,12 @@ public class MainMenuManager : MonoBehaviour {
|
||||
|
||||
[SerializeField] [Required]
|
||||
Transform optionsParent;
|
||||
[SerializeField] [Required]
|
||||
Transform helpParent;
|
||||
[SerializeField] [Required]
|
||||
Transform howToParent;
|
||||
[SerializeField] [Required]
|
||||
Transform controlsParent;
|
||||
|
||||
[SerializeField] [Required]
|
||||
GameTimer gameTimer;
|
||||
@ -42,7 +50,7 @@ public class MainMenuManager : MonoBehaviour {
|
||||
TMP_Dropdown displayModeDropdown;
|
||||
|
||||
MenuMode mode;
|
||||
MenuMode? preOptionsMode;
|
||||
MenuMode? lastMode;
|
||||
|
||||
void Awake() => SetMenuMode(MenuMode.MainMenu);
|
||||
|
||||
@ -64,12 +72,11 @@ public class MainMenuManager : MonoBehaviour {
|
||||
startMenuParent.gameObject.SetActive(mode == MenuMode.MainMenu);
|
||||
pauseParent.gameObject.SetActive(mode == MenuMode.PauseMenu);
|
||||
optionsParent.gameObject.SetActive(mode == MenuMode.Options);
|
||||
if (mode == MenuMode.Options) {
|
||||
if (this.mode != MenuMode.Options)
|
||||
preOptionsMode = this.mode;
|
||||
} else {
|
||||
preOptionsMode = null;
|
||||
}
|
||||
helpParent.gameObject.SetActive(mode == MenuMode.HowTo || mode == MenuMode.Controls);
|
||||
howToParent.gameObject.SetActive(mode == MenuMode.HowTo);
|
||||
controlsParent.gameObject.SetActive(mode == MenuMode.Controls);
|
||||
if(this.mode == MenuMode.MainMenu || this.mode == MenuMode.PauseMenu)
|
||||
lastMode = this.mode;
|
||||
|
||||
this.mode = mode;
|
||||
ResetMenuState();
|
||||
@ -77,9 +84,9 @@ public class MainMenuManager : MonoBehaviour {
|
||||
|
||||
public void SetOptions() => SetMenuMode(MenuMode.Options);
|
||||
|
||||
public void ExitOptions() {
|
||||
if (preOptionsMode != null)
|
||||
SetMenuMode(preOptionsMode.Value);
|
||||
public void BackToLastMode() {
|
||||
if (lastMode != null)
|
||||
SetMenuMode(lastMode.Value);
|
||||
}
|
||||
|
||||
public void ResetMenuState() {
|
||||
@ -87,6 +94,8 @@ public class MainMenuManager : MonoBehaviour {
|
||||
MenuMode.MainMenu => startMenuParent.GetChild(0).gameObject,
|
||||
MenuMode.PauseMenu => pauseParent.GetChild(0).gameObject,
|
||||
MenuMode.Options => optionsParent.GetChild(0).gameObject,
|
||||
MenuMode.HowTo => helpParent.GetChild(0).gameObject,
|
||||
MenuMode.Controls => helpParent.GetChild(1).gameObject,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(mode), mode, null)
|
||||
};
|
||||
eventSystem.firstSelectedGameObject = selected;
|
||||
@ -103,6 +112,9 @@ public class MainMenuManager : MonoBehaviour {
|
||||
|
||||
public void ToGameplayFlowState() => gameFlowManager.ToGameplayFlowState();
|
||||
|
||||
public void SetHowTo() => SetMenuMode(MenuMode.HowTo);
|
||||
public void SetControls() => SetMenuMode(MenuMode.Controls);
|
||||
|
||||
public void DisplayModeChange() {
|
||||
Screen.fullScreenMode = displayModeDropdown.value switch {
|
||||
0 => FullScreenMode.Windowed,
|
||||
|
||||
@ -24,26 +24,26 @@ public class ScreenShaker : MonoBehaviour {
|
||||
|
||||
public void StartHeldRumble(float rumbleLowFreq = 0.25f, float rumbleHighFreq = 0.75f) {
|
||||
heldRumble = (rumbleLowFreq, rumbleHighFreq);
|
||||
Gamepad.current.SetMotorSpeeds(rumbleLowFreq, rumbleHighFreq);
|
||||
Gamepad.current?.SetMotorSpeeds(rumbleLowFreq, rumbleHighFreq);
|
||||
}
|
||||
|
||||
public void StopHeldRumble() {
|
||||
heldRumble = null;
|
||||
Gamepad.current.ResetHaptics();
|
||||
Gamepad.current?.ResetHaptics();
|
||||
}
|
||||
|
||||
IEnumerator ShakeCoroutine(float magnitude, float rumbleLowFreq, float rumbleHighFreq, float duration) {
|
||||
noise.m_AmplitudeGain = magnitude;
|
||||
noise.m_FrequencyGain = 10f;
|
||||
Gamepad.current.SetMotorSpeeds(rumbleLowFreq, rumbleHighFreq);
|
||||
Gamepad.current?.SetMotorSpeeds(rumbleLowFreq, rumbleHighFreq);
|
||||
|
||||
yield return new WaitForSecondsRealtime(duration);
|
||||
|
||||
noise.m_AmplitudeGain = 0f;
|
||||
noise.m_FrequencyGain = 1f;
|
||||
if (heldRumble != null)
|
||||
Gamepad.current.SetMotorSpeeds(heldRumble.Value.Item1, heldRumble.Value.Item2);
|
||||
Gamepad.current?.SetMotorSpeeds(heldRumble.Value.Item1, heldRumble.Value.Item2);
|
||||
else
|
||||
Gamepad.current.ResetHaptics();
|
||||
Gamepad.current?.ResetHaptics();
|
||||
}
|
||||
}
|
||||
|
||||
@ -356,6 +356,17 @@
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "68f3cf81-d755-42c3-bbc3-e2dc73988056",
|
||||
"path": "<Keyboard>/escape",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "Keyboard&Mouse",
|
||||
"action": "Start",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "6264d8cf-a124-4ae2-a851-5ce21b5b0306",
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user