Added help menu

This commit is contained in:
Soulaha Balde 2022-04-04 02:26:58 -04:00
parent b75c58e5ca
commit 8a2cd99e5c
8 changed files with 3831 additions and 183 deletions

View File

@ -62381,10 +62381,10 @@ MonoBehaviour:
- position: {x: 10, y: -10} - position: {x: 10, y: -10}
direction: {x: 0, y: 1} direction: {x: 0, y: 1}
stats: {fileID: 11400000, guid: fe319ad8c9a37b84e8b45268c913d54c, type: 2} 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} <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} <minionParent>k__BackingField: {fileID: 1787272690}
<graveyard>k__BackingField: {fileID: 1550580935} <graveyard>k__BackingField: {fileID: 1550580935}
currWaveSize: 0 currWaveSize: 0

File diff suppressed because it is too large Load Diff

View File

@ -256,7 +256,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Navigation: m_Navigation:
m_Mode: 3 m_Mode: 0
m_WrapAround: 0 m_WrapAround: 0
m_SelectOnUp: {fileID: 0} m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0} m_SelectOnDown: {fileID: 0}
@ -282,7 +282,7 @@ MonoBehaviour:
m_PressedTrigger: Pressed m_PressedTrigger: Pressed
m_SelectedTrigger: Selected m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled m_DisabledTrigger: Disabled
m_Interactable: 1 m_Interactable: 0
m_TargetGraphic: {fileID: 0} m_TargetGraphic: {fileID: 0}
m_FillRect: {fileID: 358338754108010580} m_FillRect: {fileID: 358338754108010580}
m_HandleRect: {fileID: 0} m_HandleRect: {fileID: 0}

View File

@ -627,7 +627,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Navigation: m_Navigation:
m_Mode: 3 m_Mode: 0
m_WrapAround: 0 m_WrapAround: 0
m_SelectOnUp: {fileID: 0} m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0} m_SelectOnDown: {fileID: 0}
@ -653,7 +653,7 @@ MonoBehaviour:
m_PressedTrigger: Pressed m_PressedTrigger: Pressed
m_SelectedTrigger: Selected m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled m_DisabledTrigger: Disabled
m_Interactable: 1 m_Interactable: 0
m_TargetGraphic: {fileID: 0} m_TargetGraphic: {fileID: 0}
m_FillRect: {fileID: 1878107874529155599} m_FillRect: {fileID: 1878107874529155599}
m_HandleRect: {fileID: 0} m_HandleRect: {fileID: 0}

View File

@ -13,6 +13,8 @@ public class MainMenuManager : MonoBehaviour {
MainMenu, MainMenu,
PauseMenu, PauseMenu,
Options, Options,
HowTo,
Controls
} }
[SerializeField] [Required] [SerializeField] [Required]
@ -31,6 +33,12 @@ public class MainMenuManager : MonoBehaviour {
[SerializeField] [Required] [SerializeField] [Required]
Transform optionsParent; Transform optionsParent;
[SerializeField] [Required]
Transform helpParent;
[SerializeField] [Required]
Transform howToParent;
[SerializeField] [Required]
Transform controlsParent;
[SerializeField] [Required] [SerializeField] [Required]
GameTimer gameTimer; GameTimer gameTimer;
@ -42,7 +50,7 @@ public class MainMenuManager : MonoBehaviour {
TMP_Dropdown displayModeDropdown; TMP_Dropdown displayModeDropdown;
MenuMode mode; MenuMode mode;
MenuMode? preOptionsMode; MenuMode? lastMode;
void Awake() => SetMenuMode(MenuMode.MainMenu); void Awake() => SetMenuMode(MenuMode.MainMenu);
@ -64,12 +72,11 @@ public class MainMenuManager : MonoBehaviour {
startMenuParent.gameObject.SetActive(mode == MenuMode.MainMenu); startMenuParent.gameObject.SetActive(mode == MenuMode.MainMenu);
pauseParent.gameObject.SetActive(mode == MenuMode.PauseMenu); pauseParent.gameObject.SetActive(mode == MenuMode.PauseMenu);
optionsParent.gameObject.SetActive(mode == MenuMode.Options); optionsParent.gameObject.SetActive(mode == MenuMode.Options);
if (mode == MenuMode.Options) { helpParent.gameObject.SetActive(mode == MenuMode.HowTo || mode == MenuMode.Controls);
if (this.mode != MenuMode.Options) howToParent.gameObject.SetActive(mode == MenuMode.HowTo);
preOptionsMode = this.mode; controlsParent.gameObject.SetActive(mode == MenuMode.Controls);
} else { if(this.mode == MenuMode.MainMenu || this.mode == MenuMode.PauseMenu)
preOptionsMode = null; lastMode = this.mode;
}
this.mode = mode; this.mode = mode;
ResetMenuState(); ResetMenuState();
@ -77,9 +84,9 @@ public class MainMenuManager : MonoBehaviour {
public void SetOptions() => SetMenuMode(MenuMode.Options); public void SetOptions() => SetMenuMode(MenuMode.Options);
public void ExitOptions() { public void BackToLastMode() {
if (preOptionsMode != null) if (lastMode != null)
SetMenuMode(preOptionsMode.Value); SetMenuMode(lastMode.Value);
} }
public void ResetMenuState() { public void ResetMenuState() {
@ -87,6 +94,8 @@ public class MainMenuManager : MonoBehaviour {
MenuMode.MainMenu => startMenuParent.GetChild(0).gameObject, MenuMode.MainMenu => startMenuParent.GetChild(0).gameObject,
MenuMode.PauseMenu => pauseParent.GetChild(0).gameObject, MenuMode.PauseMenu => pauseParent.GetChild(0).gameObject,
MenuMode.Options => optionsParent.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) _ => throw new ArgumentOutOfRangeException(nameof(mode), mode, null)
}; };
eventSystem.firstSelectedGameObject = selected; eventSystem.firstSelectedGameObject = selected;
@ -103,6 +112,9 @@ public class MainMenuManager : MonoBehaviour {
public void ToGameplayFlowState() => gameFlowManager.ToGameplayFlowState(); public void ToGameplayFlowState() => gameFlowManager.ToGameplayFlowState();
public void SetHowTo() => SetMenuMode(MenuMode.HowTo);
public void SetControls() => SetMenuMode(MenuMode.Controls);
public void DisplayModeChange() { public void DisplayModeChange() {
Screen.fullScreenMode = displayModeDropdown.value switch { Screen.fullScreenMode = displayModeDropdown.value switch {
0 => FullScreenMode.Windowed, 0 => FullScreenMode.Windowed,

View File

@ -24,26 +24,26 @@ public class ScreenShaker : MonoBehaviour {
public void StartHeldRumble(float rumbleLowFreq = 0.25f, float rumbleHighFreq = 0.75f) { public void StartHeldRumble(float rumbleLowFreq = 0.25f, float rumbleHighFreq = 0.75f) {
heldRumble = (rumbleLowFreq, rumbleHighFreq); heldRumble = (rumbleLowFreq, rumbleHighFreq);
Gamepad.current.SetMotorSpeeds(rumbleLowFreq, rumbleHighFreq); Gamepad.current?.SetMotorSpeeds(rumbleLowFreq, rumbleHighFreq);
} }
public void StopHeldRumble() { public void StopHeldRumble() {
heldRumble = null; heldRumble = null;
Gamepad.current.ResetHaptics(); Gamepad.current?.ResetHaptics();
} }
IEnumerator ShakeCoroutine(float magnitude, float rumbleLowFreq, float rumbleHighFreq, float duration) { IEnumerator ShakeCoroutine(float magnitude, float rumbleLowFreq, float rumbleHighFreq, float duration) {
noise.m_AmplitudeGain = magnitude; noise.m_AmplitudeGain = magnitude;
noise.m_FrequencyGain = 10f; noise.m_FrequencyGain = 10f;
Gamepad.current.SetMotorSpeeds(rumbleLowFreq, rumbleHighFreq); Gamepad.current?.SetMotorSpeeds(rumbleLowFreq, rumbleHighFreq);
yield return new WaitForSecondsRealtime(duration); yield return new WaitForSecondsRealtime(duration);
noise.m_AmplitudeGain = 0f; noise.m_AmplitudeGain = 0f;
noise.m_FrequencyGain = 1f; noise.m_FrequencyGain = 1f;
if (heldRumble != null) if (heldRumble != null)
Gamepad.current.SetMotorSpeeds(heldRumble.Value.Item1, heldRumble.Value.Item2); Gamepad.current?.SetMotorSpeeds(heldRumble.Value.Item1, heldRumble.Value.Item2);
else else
Gamepad.current.ResetHaptics(); Gamepad.current?.ResetHaptics();
} }
} }

View File

@ -356,6 +356,17 @@
"isComposite": false, "isComposite": false,
"isPartOfComposite": 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": "", "name": "",
"id": "6264d8cf-a124-4ae2-a851-5ce21b5b0306", "id": "6264d8cf-a124-4ae2-a851-5ce21b5b0306",

File diff suppressed because one or more lines are too long