Added User Manual and fixes

Added help button on the title screen with animation. Added User Manual to appear after clicking the button, and vice versa. Added tons of catches to handle unwanted errors.
This commit is contained in:
djkellerman
2025-04-18 02:50:50 -04:00
parent 0838aebf89
commit 9578af346b
8 changed files with 2094 additions and 42 deletions

View File

@@ -66,6 +66,49 @@ AnimationClip:
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
path: Pentagon/Platformer path: Pentagon/Platformer
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0, y: 0, z: 225}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.6666667
value: {x: 0, y: 0, z: 210}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.8333333
value: {x: 0, y: 0, z: 240}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1
value: {x: 0, y: 0, z: 225}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: Pentagon/HelpButton
m_PositionCurves: [] m_PositionCurves: []
m_ScaleCurves: [] m_ScaleCurves: []
m_FloatCurves: m_FloatCurves:
@@ -249,6 +292,66 @@ AnimationClip:
classID: 224 classID: 224
script: {fileID: 0} script: {fileID: 0}
flags: 0 flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: -18
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.75
value: -9.46
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_AnchoredPosition.x
path: Pentagon/HelpButton
classID: 224
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 45
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.75
value: 28.78
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_AnchoredPosition.y
path: Pentagon/HelpButton
classID: 224
script: {fileID: 0}
flags: 0
m_PPtrCurves: [] m_PPtrCurves: []
m_SampleRate: 60 m_SampleRate: 60
m_WrapMode: 0 m_WrapMode: 0
@@ -266,6 +369,15 @@ AnimationClip:
isPPtrCurve: 0 isPPtrCurve: 0
isIntCurve: 0 isIntCurve: 0
isSerializeReferenceCurve: 0 isSerializeReferenceCurve: 0
- serializedVersion: 2
path: 761887162
attribute: 4
script: {fileID: 0}
typeID: 4
customType: 4
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
- serializedVersion: 2 - serializedVersion: 2
path: 2762377838 path: 2762377838
attribute: 1460864421 attribute: 1460864421
@@ -320,6 +432,24 @@ AnimationClip:
isPPtrCurve: 0 isPPtrCurve: 0
isIntCurve: 0 isIntCurve: 0
isSerializeReferenceCurve: 0 isSerializeReferenceCurve: 0
- serializedVersion: 2
path: 761887162
attribute: 1460864421
script: {fileID: 0}
typeID: 224
customType: 28
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
- serializedVersion: 2
path: 761887162
attribute: 538195251
script: {fileID: 0}
typeID: 224
customType: 28
isPPtrCurve: 0
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping: [] pptrCurveMapping: []
m_AnimationClipSettings: m_AnimationClipSettings:
serializedVersion: 2 serializedVersion: 2
@@ -693,6 +823,210 @@ AnimationClip:
classID: 224 classID: 224
script: {fileID: 0} script: {fileID: 0}
flags: 0 flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.6666667
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.8333333
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.x
path: Pentagon/HelpButton
classID: 224
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.6666667
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.8333333
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.y
path: Pentagon/HelpButton
classID: 224
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 225
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.6666667
value: 210
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.8333333
value: 240
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 225
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.z
path: Pentagon/HelpButton
classID: 224
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: -18
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.75
value: -9.46
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_AnchoredPosition.x
path: Pentagon/HelpButton
classID: 224
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 45
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.75
value: 28.78
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_AnchoredPosition.y
path: Pentagon/HelpButton
classID: 224
script: {fileID: 0}
flags: 0
m_EulerEditorCurves: m_EulerEditorCurves:
- serializedVersion: 2 - serializedVersion: 2
curve: curve:
@@ -701,7 +1035,7 @@ AnimationClip:
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
attribute: m_LocalEulerAngles.x attribute: m_LocalEulerAngles.z
path: Pentagon/Platformer path: Pentagon/Platformer
classID: 224 classID: 224
script: {fileID: 0} script: {fileID: 0}
@@ -725,11 +1059,47 @@ AnimationClip:
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
attribute: m_LocalEulerAngles.z attribute: m_LocalEulerAngles.x
path: Pentagon/Platformer path: Pentagon/Platformer
classID: 224 classID: 224
script: {fileID: 0} script: {fileID: 0}
flags: 0 flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.x
path: Pentagon/HelpButton
classID: 224
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.y
path: Pentagon/HelpButton
classID: 224
script: {fileID: 0}
flags: 0
- serializedVersion: 2
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.z
path: Pentagon/HelpButton
classID: 224
script: {fileID: 0}
flags: 0
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events: []

View File

@@ -52,31 +52,43 @@ public class HubManager : MonoBehaviour
ChangeGameButtonsInteractability(false); ChangeGameButtonsInteractability(false);
} }
private void Update() private void Update()
{ {
if (InputSystem.GetDevice<Keyboard>().escapeKey.wasPressedThisFrame) if (InputSystem.GetDevice<Keyboard>().escapeKey.wasPressedThisFrame)
{ {
UnloadGameScene(); UnloadGameScene();
ChangeGameButtonsInteractability(true); ChangeGameButtonsInteractability(true);
if (GameManager.players != null)
foreach (GameObject player in GameManager.players.ToList())
{ {
GameManager.players.Remove(player); foreach (GameObject player in GameManager.players.ToList())
Destroy(player); {
GameManager.players.Remove(player);
if (player != null)
{
Destroy(player);
}
}
} }
if (MusicManager.Instance != null)
MusicManager.Instance.StartPlaylist("Title Screen");
foreach (Camera camera in FindObjectsByType<Camera>(FindObjectsSortMode.None))
{ {
camera.enabled = false; MusicManager.Instance.StartPlaylist("Title Screen");
}
var cameras = FindObjectsByType<Camera>(FindObjectsSortMode.None);
if (cameras != null)
{
foreach (Camera camera in cameras)
{
camera.enabled = false;
}
}
GameManager.players?.Clear();
GameManager.playerColors?.Clear();
if (GameManager.Instance != null)
{
GameManager.Instance.gameOver = false;
} }
GameManager.players.Clear();
GameManager.playerColors.Clear();
GameManager.Instance.gameOver = false;
SceneManager.LoadScene("Title Screen"); SceneManager.LoadScene("Title Screen");
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -21,8 +21,15 @@ namespace Game
public PlayerJoinCard CreateCard() // Creates a player join card public PlayerJoinCard CreateCard() // Creates a player join card
{ {
GameObject card = Instantiate(playerJoinCardPrefab, transform); try
return card.GetComponent<PlayerJoinCard>(); {
GameObject card = Instantiate(playerJoinCardPrefab, transform);
return card.GetComponent<PlayerJoinCard>();
}
catch
{
return null;
}
} }
} }
} }

View File

@@ -68,7 +68,10 @@ public class GameManager : MonoBehaviour
/// </summary> /// </summary>
private void Start() private void Start()
{ {
MusicManager.Instance.StartPlaylist(); if (MusicManager.Instance != null)
{
MusicManager.Instance.StartPlaylist();
}
StartGame(); StartGame();
} }
@@ -124,8 +127,11 @@ public class GameManager : MonoBehaviour
} }
if (gameMode == GameMode.keepAway) if (gameMode == GameMode.keepAway)
{ {
gameTimer.startTime = time; if (gameTimer != null)
gameTimer.StartTimer(); {
gameTimer.startTime = time;
gameTimer.StartTimer();
}
foreach (GameObject player in players) foreach (GameObject player in players)
{ {
player.transform.position = spawnPosition + (offset * players.IndexOf(player) * Vector2.right); player.transform.position = spawnPosition + (offset * players.IndexOf(player) * Vector2.right);
@@ -203,11 +209,17 @@ public class GameManager : MonoBehaviour
/// </summary> /// </summary>
public void GameOver() public void GameOver()
{ {
if (LeaderboardCanvas == null){}
gameOver = true; gameOver = true;
EndGameEvent?.Invoke(); EndGameEvent?.Invoke();
LeaderboardCanvas.gameObject.SetActive(false); if (LeaderboardCanvas != null)
TimerCanvas.gameObject.SetActive(false); {
LeaderboardCanvas.gameObject.SetActive(false);
}
if (TimerCanvas != null)
{
TimerCanvas.gameObject.SetActive(false);
}
if (gameMode == GameMode.freeForAll) if (gameMode == GameMode.freeForAll)
{ {
GameObject winner = AlivePlayers()[0]; GameObject winner = AlivePlayers()[0];
@@ -231,13 +243,24 @@ public class GameManager : MonoBehaviour
if (winner != null) if (winner != null)
{ {
print(winner.name + " is the winner with " + maxHoldTime + " seconds!"); print(winner.name + " is the winner with " + maxHoldTime + " seconds!");
FindFirstObjectByType<PlayerCameraMovement>().WinScene(winner); var cameraMovement = FindFirstObjectByType<PlayerCameraMovement>();
if (cameraMovement != null)
{
cameraMovement.WinScene(winner);
}
WinScreen.Instance.ShowWinScreen(players.IndexOf(winner) + 1); WinScreen.Instance.ShowWinScreen(players.IndexOf(winner) + 1);
FindFirstObjectByType<LifeDisplayManager>().HideLifeDisplay(); var lifeDisplayManager = FindFirstObjectByType<LifeDisplayManager>();
if (lifeDisplayManager != null)
{
lifeDisplayManager.HideLifeDisplay();
}
StartCoroutine(MoveHatToWinner(winner)); StartCoroutine(MoveHatToWinner(winner));
hatObject.SetActive(true); if (hatObject != null)
hatObject.GetComponent<Collider2D>().enabled = true; {
hatObject.GetComponent<Rigidbody2D>().bodyType = RigidbodyType2D.Dynamic; hatObject.SetActive(true);
hatObject.GetComponent<Collider2D>().enabled = true;
hatObject.GetComponent<Rigidbody2D>().bodyType = RigidbodyType2D.Dynamic;
}
} }
} }
if (gameMode == GameMode.obstacleCourse) if (gameMode == GameMode.obstacleCourse)

View File

@@ -0,0 +1,18 @@
using UnityEngine;
public class UserManualPopup : MonoBehaviour
{
public GameObject popupPanel;
public void ShowPopup()
{
popupPanel.SetActive(true);
gameObject.SetActive(true);
}
public void HidePopup()
{
popupPanel.SetActive(false);
gameObject.SetActive(false);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 3f3390a791c72be41ab00266e23fe518

View File

@@ -32,11 +32,23 @@ public class PlayerManager : MonoBehaviour
Destroy(playerInput.gameObject); Destroy(playerInput.gameObject);
return; return;
} }
Debug.Log("Player joined"); print("Player joined");
DontDestroyOnLoad(playerInput.gameObject); DontDestroyOnLoad(playerInput.gameObject);
if (PlayerCardCreator.Instance == null)
{
return;
}
PlayerJoinCard card = PlayerCardCreator.Instance.CreateCard(); PlayerJoinCard card = PlayerCardCreator.Instance.CreateCard();
if (card == null)
{
return;
}
card.playerNumber = GameManager.players.Count + 1; card.playerNumber = GameManager.players.Count + 1;
cards.Add(card); cards.Add(card);
if (GameManager.players == null)
{
GameManager.players = new List<GameObject>();
}
GameManager.players.Add(playerInput.gameObject); GameManager.players.Add(playerInput.gameObject);
Colorize(GameManager.players.Count - 1); Colorize(GameManager.players.Count - 1);
} }
@@ -46,7 +58,7 @@ public class PlayerManager : MonoBehaviour
{ {
Destroy(playerInput.gameObject); Destroy(playerInput.gameObject);
GameManager.players.Remove(playerInput.gameObject); GameManager.players.Remove(playerInput.gameObject);
Debug.Log("Player left"); print("Player left");
} }
private void Init() private void Init()