Compare commits

..

No commits in common. "fc9307d5d0895c2fd67b6750681b05f21fc50ae3" and "5f8b0f167073082ef501379fefbf16ace275f5a1" have entirely different histories.

4 changed files with 4497 additions and 1020 deletions

File diff suppressed because one or more lines are too long

View file

@ -13,28 +13,18 @@ using UnityEngine;
public class AerialFaithDeathTrigger : MonoBehaviour public class AerialFaithDeathTrigger : MonoBehaviour
{ {
/// <summary> /// <summary>
/// the first trigger that detects if the player has jumped out of the play area /// the trigger that detects if the player has jumped out of the play area
/// </summary> /// </summary>
[SerializeField] private AerialFaithLeapTrigger linkedLeapTrigger1; [SerializeField] private AerialFaithLeapTrigger linkedLeapTrigger;
/// <summary> /// <summary>
/// the second trigger that detects if the player has jumped out of the play area /// check if linkedLeapTrigger is set
/// </summary>
[SerializeField] private AerialFaithLeapTrigger linkedLeapTrigger2;
/// <summary>
/// the third trigger that detects if the player has jumped out of the play area
/// </summary>
[SerializeField] private AerialFaithLeapTrigger linkedLeapTrigger3;
/// <summary>
/// check if linkedLeapTrigger1 is set
/// </summary> /// </summary>
/// <exception cref="NullReferenceException">consequential exception</exception> /// <exception cref="NullReferenceException">consequential exception</exception>
private void Awake() private void Awake()
{ {
if (linkedLeapTrigger1 == null) if (linkedLeapTrigger == null)
throw new NullReferenceException("AerialFaithLandingTrigger: linkedLeapTrigger1 is not set"); throw new NullReferenceException("AerialFaithLandingTrigger: linkedLeapTrigger is not set");
} }
/// <summary> /// <summary>
@ -45,19 +35,22 @@ public class AerialFaithDeathTrigger : MonoBehaviour
{ {
// Debug.Log($"AerialFaithDeathTrigger: was hit by object with tag {other.tag}"); // Debug.Log($"AerialFaithDeathTrigger: was hit by object with tag {other.tag}");
// proceed if: if (!other.CompareTag("Player") || !linkedLeapTrigger.isPlayerInAir) return;
// - the colliding object is the player
// - any of the linked leap triggers are active, the 1st is always not null // if (!other.CompareTag("Player"))
if (!other.CompareTag("Player")) return; // {
if (!(linkedLeapTrigger1.isPlayerInAir || // Debug.Log("AerialFaithDeathTrigger: player missed");
(linkedLeapTrigger2 != null && linkedLeapTrigger2.isPlayerInAir) || // return;
(linkedLeapTrigger3 != null && linkedLeapTrigger3.isPlayerInAir))) // }
return; //
// if (!linkedLeapTrigger.isPlayerInAir)
// {
// Debug.Log("AerialFaithDeathTrigger: player is in an invalid state");
// return;
// }
Debug.Log("AerialFaithDeathTrigger: player missed, and will be baked"); Debug.Log("AerialFaithDeathTrigger: player missed, and will be baked");
linkedLeapTrigger1.isPlayerInAir = false; linkedLeapTrigger.isPlayerInAir = false;
if (linkedLeapTrigger2 != null) linkedLeapTrigger2.isPlayerInAir = false;
if (linkedLeapTrigger3 != null) linkedLeapTrigger3.isPlayerInAir = false;
// TODO: kill player // TODO: kill player
} }
} }

View file

@ -13,28 +13,18 @@ using UnityEngine;
public class AerialFaithLandingTrigger : MonoBehaviour public class AerialFaithLandingTrigger : MonoBehaviour
{ {
/// <summary> /// <summary>
/// the first trigger that detects if the player has jumped out of the play area /// the trigger that detects if the player has jumped out of the play area
/// </summary> /// </summary>
[SerializeField] private AerialFaithLeapTrigger linkedLeapTrigger1; [SerializeField] private AerialFaithLeapTrigger linkedLeapTrigger;
/// <summary> /// <summary>
/// the second trigger that detects if the player has jumped out of the play area /// check if linkedLeapTrigger is set
/// </summary>
[SerializeField] private AerialFaithLeapTrigger linkedLeapTrigger2;
/// <summary>
/// the third trigger that detects if the player has jumped out of the play area
/// </summary>
[SerializeField] private AerialFaithLeapTrigger linkedLeapTrigger3;
/// <summary>
/// check if linkedLeapTrigger1 is set
/// </summary> /// </summary>
/// <exception cref="NullReferenceException">consequential exception</exception> /// <exception cref="NullReferenceException">consequential exception</exception>
private void Awake() private void Awake()
{ {
if (linkedLeapTrigger1 == null) if (linkedLeapTrigger == null)
throw new NullReferenceException("AerialFaithLandingTrigger: linkedLeapTrigger1 is not set"); throw new NullReferenceException("AerialFaithLandingTrigger: linkedLeapTrigger is not set");
} }
/// <summary> /// <summary>
@ -44,19 +34,8 @@ public class AerialFaithLandingTrigger : MonoBehaviour
private void OnTriggerEnter(Collider other) private void OnTriggerEnter(Collider other)
{ {
// Debug.Log($"AerialFaithLandingTrigger: was hit by object with tag {other.tag}"); // Debug.Log($"AerialFaithLandingTrigger: was hit by object with tag {other.tag}");
if (!other.CompareTag("Player") || !linkedLeapTrigger.isPlayerInAir) return;
// proceed if:
// - the colliding object is the player
// - any of the linked leap triggers are active, the 1st is always not null
if (!other.CompareTag("Player")) return;
if (!(linkedLeapTrigger1.isPlayerInAir ||
(linkedLeapTrigger2 != null && linkedLeapTrigger2.isPlayerInAir) ||
(linkedLeapTrigger3 != null && linkedLeapTrigger3.isPlayerInAir)))
return;
Debug.Log("AerialFaithLandingTrigger: player landed"); Debug.Log("AerialFaithLandingTrigger: player landed");
linkedLeapTrigger1.isPlayerInAir = false; linkedLeapTrigger.isPlayerInAir = false;
if (linkedLeapTrigger2 != null) linkedLeapTrigger2.isPlayerInAir = false;
if (linkedLeapTrigger3 != null) linkedLeapTrigger3.isPlayerInAir = false;
} }
} }

View file

@ -30,6 +30,6 @@ public class MarkPlayer : MonoBehaviour
public void OnPause() public void OnPause()
{ {
Debug.Log("escape pressed"); Debug.Log("escape pressed");
_game.SetDisplayState(_game.Paused ? GameManager.DisplayState.Game : GameManager.DisplayState.OverlayPauseMenu); _game.SetDisplayState(_game.Paused ? GameManager.DisplayState.Game : GameManager.DisplayState.ScreenPauseMenu);
} }
} }