game: get aerial faith working again
This commit is contained in:
parent
2d13cb0bc6
commit
fc9307d5d0
File diff suppressed because one or more lines are too long
|
@ -13,18 +13,28 @@
|
||||||
public class AerialFaithDeathTrigger : MonoBehaviour
|
public class AerialFaithDeathTrigger : MonoBehaviour
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// the trigger that detects if the player has jumped out of the play area
|
/// the first trigger that detects if the player has jumped out of the play area
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SerializeField] private AerialFaithLeapTrigger linkedLeapTrigger;
|
[SerializeField] private AerialFaithLeapTrigger linkedLeapTrigger1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// check if linkedLeapTrigger is set
|
/// the second trigger that detects if the player has jumped out of the play area
|
||||||
|
/// </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 (linkedLeapTrigger == null)
|
if (linkedLeapTrigger1 == null)
|
||||||
throw new NullReferenceException("AerialFaithLandingTrigger: linkedLeapTrigger is not set");
|
throw new NullReferenceException("AerialFaithLandingTrigger: linkedLeapTrigger1 is not set");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -35,22 +45,19 @@ private void OnTriggerEnter(Collider other)
|
||||||
{
|
{
|
||||||
// Debug.Log($"AerialFaithDeathTrigger: was hit by object with tag {other.tag}");
|
// Debug.Log($"AerialFaithDeathTrigger: was hit by object with tag {other.tag}");
|
||||||
|
|
||||||
if (!other.CompareTag("Player") || !linkedLeapTrigger.isPlayerInAir) return;
|
// proceed if:
|
||||||
|
// - the colliding object is the player
|
||||||
// if (!other.CompareTag("Player"))
|
// - any of the linked leap triggers are active, the 1st is always not null
|
||||||
// {
|
if (!other.CompareTag("Player")) return;
|
||||||
// Debug.Log("AerialFaithDeathTrigger: player missed");
|
if (!(linkedLeapTrigger1.isPlayerInAir ||
|
||||||
// return;
|
(linkedLeapTrigger2 != null && linkedLeapTrigger2.isPlayerInAir) ||
|
||||||
// }
|
(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");
|
||||||
linkedLeapTrigger.isPlayerInAir = false;
|
linkedLeapTrigger1.isPlayerInAir = false;
|
||||||
|
if (linkedLeapTrigger2 != null) linkedLeapTrigger2.isPlayerInAir = false;
|
||||||
|
if (linkedLeapTrigger3 != null) linkedLeapTrigger3.isPlayerInAir = false;
|
||||||
// TODO: kill player
|
// TODO: kill player
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -13,18 +13,28 @@
|
||||||
public class AerialFaithLandingTrigger : MonoBehaviour
|
public class AerialFaithLandingTrigger : MonoBehaviour
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// the trigger that detects if the player has jumped out of the play area
|
/// the first trigger that detects if the player has jumped out of the play area
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SerializeField] private AerialFaithLeapTrigger linkedLeapTrigger;
|
[SerializeField] private AerialFaithLeapTrigger linkedLeapTrigger1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// check if linkedLeapTrigger is set
|
/// the second trigger that detects if the player has jumped out of the play area
|
||||||
|
/// </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 (linkedLeapTrigger == null)
|
if (linkedLeapTrigger1 == null)
|
||||||
throw new NullReferenceException("AerialFaithLandingTrigger: linkedLeapTrigger is not set");
|
throw new NullReferenceException("AerialFaithLandingTrigger: linkedLeapTrigger1 is not set");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -34,8 +44,19 @@ private void Awake()
|
||||||
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");
|
||||||
linkedLeapTrigger.isPlayerInAir = false;
|
linkedLeapTrigger1.isPlayerInAir = false;
|
||||||
|
if (linkedLeapTrigger2 != null) linkedLeapTrigger2.isPlayerInAir = false;
|
||||||
|
if (linkedLeapTrigger3 != null) linkedLeapTrigger3.isPlayerInAir = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in a new issue