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:
@@ -66,6 +66,49 @@ AnimationClip:
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
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_ScaleCurves: []
|
||||
m_FloatCurves:
|
||||
@@ -249,6 +292,66 @@ AnimationClip:
|
||||
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_PPtrCurves: []
|
||||
m_SampleRate: 60
|
||||
m_WrapMode: 0
|
||||
@@ -266,6 +369,15 @@ AnimationClip:
|
||||
isPPtrCurve: 0
|
||||
isIntCurve: 0
|
||||
isSerializeReferenceCurve: 0
|
||||
- serializedVersion: 2
|
||||
path: 761887162
|
||||
attribute: 4
|
||||
script: {fileID: 0}
|
||||
typeID: 4
|
||||
customType: 4
|
||||
isPPtrCurve: 0
|
||||
isIntCurve: 0
|
||||
isSerializeReferenceCurve: 0
|
||||
- serializedVersion: 2
|
||||
path: 2762377838
|
||||
attribute: 1460864421
|
||||
@@ -320,6 +432,24 @@ AnimationClip:
|
||||
isPPtrCurve: 0
|
||||
isIntCurve: 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: []
|
||||
m_AnimationClipSettings:
|
||||
serializedVersion: 2
|
||||
@@ -693,6 +823,210 @@ AnimationClip:
|
||||
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.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:
|
||||
- serializedVersion: 2
|
||||
curve:
|
||||
@@ -701,7 +1035,7 @@ AnimationClip:
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalEulerAngles.x
|
||||
attribute: m_LocalEulerAngles.z
|
||||
path: Pentagon/Platformer
|
||||
classID: 224
|
||||
script: {fileID: 0}
|
||||
@@ -725,11 +1059,47 @@ AnimationClip:
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_LocalEulerAngles.z
|
||||
attribute: m_LocalEulerAngles.x
|
||||
path: Pentagon/Platformer
|
||||
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.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_HasMotionFloatCurves: 0
|
||||
m_Events: []
|
||||
|
||||
@@ -58,25 +58,37 @@ public class HubManager : MonoBehaviour
|
||||
{
|
||||
UnloadGameScene();
|
||||
ChangeGameButtonsInteractability(true);
|
||||
|
||||
if (GameManager.players != null)
|
||||
{
|
||||
foreach (GameObject player in GameManager.players.ToList())
|
||||
{
|
||||
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))
|
||||
}
|
||||
var cameras = FindObjectsByType<Camera>(FindObjectsSortMode.None);
|
||||
if (cameras != null)
|
||||
{
|
||||
foreach (Camera camera in cameras)
|
||||
{
|
||||
camera.enabled = false;
|
||||
}
|
||||
|
||||
GameManager.players.Clear();
|
||||
GameManager.playerColors.Clear();
|
||||
}
|
||||
GameManager.players?.Clear();
|
||||
GameManager.playerColors?.Clear();
|
||||
if (GameManager.Instance != null)
|
||||
{
|
||||
GameManager.Instance.gameOver = false;
|
||||
|
||||
}
|
||||
SceneManager.LoadScene("Title Screen");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,9 +20,16 @@ namespace Game
|
||||
}
|
||||
|
||||
public PlayerJoinCard CreateCard() // Creates a player join card
|
||||
{
|
||||
try
|
||||
{
|
||||
GameObject card = Instantiate(playerJoinCardPrefab, transform);
|
||||
return card.GetComponent<PlayerJoinCard>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,8 +67,11 @@ public class GameManager : MonoBehaviour
|
||||
/// Starts the game and initializes music.
|
||||
/// </summary>
|
||||
private void Start()
|
||||
{
|
||||
if (MusicManager.Instance != null)
|
||||
{
|
||||
MusicManager.Instance.StartPlaylist();
|
||||
}
|
||||
StartGame();
|
||||
}
|
||||
|
||||
@@ -123,9 +126,12 @@ public class GameManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
if (gameMode == GameMode.keepAway)
|
||||
{
|
||||
if (gameTimer != null)
|
||||
{
|
||||
gameTimer.startTime = time;
|
||||
gameTimer.StartTimer();
|
||||
}
|
||||
foreach (GameObject player in players)
|
||||
{
|
||||
player.transform.position = spawnPosition + (offset * players.IndexOf(player) * Vector2.right);
|
||||
@@ -203,11 +209,17 @@ public class GameManager : MonoBehaviour
|
||||
/// </summary>
|
||||
public void GameOver()
|
||||
{
|
||||
if (LeaderboardCanvas == null){}
|
||||
gameOver = true;
|
||||
EndGameEvent?.Invoke();
|
||||
if (LeaderboardCanvas != null)
|
||||
{
|
||||
LeaderboardCanvas.gameObject.SetActive(false);
|
||||
}
|
||||
if (TimerCanvas != null)
|
||||
{
|
||||
TimerCanvas.gameObject.SetActive(false);
|
||||
|
||||
}
|
||||
if (gameMode == GameMode.freeForAll)
|
||||
{
|
||||
GameObject winner = AlivePlayers()[0];
|
||||
@@ -231,15 +243,26 @@ public class GameManager : MonoBehaviour
|
||||
if (winner != null)
|
||||
{
|
||||
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);
|
||||
FindFirstObjectByType<LifeDisplayManager>().HideLifeDisplay();
|
||||
var lifeDisplayManager = FindFirstObjectByType<LifeDisplayManager>();
|
||||
if (lifeDisplayManager != null)
|
||||
{
|
||||
lifeDisplayManager.HideLifeDisplay();
|
||||
}
|
||||
StartCoroutine(MoveHatToWinner(winner));
|
||||
if (hatObject != null)
|
||||
{
|
||||
hatObject.SetActive(true);
|
||||
hatObject.GetComponent<Collider2D>().enabled = true;
|
||||
hatObject.GetComponent<Rigidbody2D>().bodyType = RigidbodyType2D.Dynamic;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (gameMode == GameMode.obstacleCourse)
|
||||
{
|
||||
GameObject winner = ObstacleCourse.playerWon;
|
||||
|
||||
18
Assets/Scripts/Game/UserManualPopup.cs
Normal file
18
Assets/Scripts/Game/UserManualPopup.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Game/UserManualPopup.cs.meta
Normal file
2
Assets/Scripts/Game/UserManualPopup.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3f3390a791c72be41ab00266e23fe518
|
||||
@@ -32,11 +32,23 @@ public class PlayerManager : MonoBehaviour
|
||||
Destroy(playerInput.gameObject);
|
||||
return;
|
||||
}
|
||||
Debug.Log("Player joined");
|
||||
print("Player joined");
|
||||
DontDestroyOnLoad(playerInput.gameObject);
|
||||
if (PlayerCardCreator.Instance == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
PlayerJoinCard card = PlayerCardCreator.Instance.CreateCard();
|
||||
if (card == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
card.playerNumber = GameManager.players.Count + 1;
|
||||
cards.Add(card);
|
||||
if (GameManager.players == null)
|
||||
{
|
||||
GameManager.players = new List<GameObject>();
|
||||
}
|
||||
GameManager.players.Add(playerInput.gameObject);
|
||||
Colorize(GameManager.players.Count - 1);
|
||||
}
|
||||
@@ -46,7 +58,7 @@ public class PlayerManager : MonoBehaviour
|
||||
{
|
||||
Destroy(playerInput.gameObject);
|
||||
GameManager.players.Remove(playerInput.gameObject);
|
||||
Debug.Log("Player left");
|
||||
print("Player left");
|
||||
}
|
||||
|
||||
private void Init()
|
||||
|
||||
Reference in New Issue
Block a user