diff --git a/RunningLateGame/Assets/Scripts/AerialFaithDeathTrigger.cs b/RunningLateGame/Assets/Scripts/AerialFaithDeathTrigger.cs new file mode 100644 index 0000000..9172704 --- /dev/null +++ b/RunningLateGame/Assets/Scripts/AerialFaithDeathTrigger.cs @@ -0,0 +1,29 @@ +/* + * author: mark joshwel + * date: 10/8/2024 + * description: trigger to detect if the player did not land in an aerial faith landing trigger + */ + +using UnityEngine; + +/// +/// detection behaviour class +/// +public class AerialFaithDeathTrigger : MonoBehaviour +{ + /// + /// the trigger that detects if the player has jumped out of the play area + /// + [SerializeField] private AerialFaithJumpTrigger linkedJumpTrigger; + + /// + /// detect if player has entered the trigger + /// + /// colliding game object + private void OnTriggerEnter(Collider other) + { + if (!other.CompareTag("Player") || !linkedJumpTrigger.isPlayerInAir) return; + Debug.Log("AerialFaithDeathTrigger: player missed, and will be baked"); + // TODO: kill player + } +} \ No newline at end of file diff --git a/RunningLateGame/Assets/Scripts/AerialFaithDeathTrigger.cs.meta b/RunningLateGame/Assets/Scripts/AerialFaithDeathTrigger.cs.meta new file mode 100644 index 0000000..e11ac40 --- /dev/null +++ b/RunningLateGame/Assets/Scripts/AerialFaithDeathTrigger.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7d5a9cf332774b06a7a334f98b8b2014 +timeCreated: 1723266227 \ No newline at end of file diff --git a/RunningLateGame/Assets/Scripts/AerialFaithJumpTrigger.cs b/RunningLateGame/Assets/Scripts/AerialFaithJumpTrigger.cs new file mode 100644 index 0000000..3d5809f --- /dev/null +++ b/RunningLateGame/Assets/Scripts/AerialFaithJumpTrigger.cs @@ -0,0 +1,28 @@ +/* + * author: mark joshwel + * date: 10/8/2024 + * description: trigger to detect if the player has jumped out of play area + */ + +using UnityEngine; + +/// +/// detection behaviour class +/// +public class AerialFaithJumpTrigger : MonoBehaviour +{ + /// + /// bool to check if player is airborne + /// + public bool isPlayerInAir; + + /// + /// detect if player has jumped out of the trigger + /// + /// colliding game object + private void OnTriggerExit(Collider other) + { + if (other.CompareTag("Player")) isPlayerInAir = true; + Debug.Log("AerialFaithJumpTrigger: player is airborne"); + } +} \ No newline at end of file diff --git a/RunningLateGame/Assets/Scripts/AerialFaithJumpTrigger.cs.meta b/RunningLateGame/Assets/Scripts/AerialFaithJumpTrigger.cs.meta new file mode 100644 index 0000000..bc87e9b --- /dev/null +++ b/RunningLateGame/Assets/Scripts/AerialFaithJumpTrigger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 27200cbaa7196664b96b3c786389d7eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/RunningLateGame/Assets/Scripts/AerialFaithLandingTrigger.cs b/RunningLateGame/Assets/Scripts/AerialFaithLandingTrigger.cs new file mode 100644 index 0000000..13d0397 --- /dev/null +++ b/RunningLateGame/Assets/Scripts/AerialFaithLandingTrigger.cs @@ -0,0 +1,29 @@ +/* + * author: mark joshwel + * date: 10/8/2024 + * description: trigger to detect if the player landed in a specific area + */ + +using UnityEngine; + +/// +/// detection behaviour class +/// +public class AerialFaithLandingTrigger : MonoBehaviour +{ + /// + /// the trigger that detects if the player has jumped out of the play area + /// + [SerializeField] private AerialFaithJumpTrigger linkedJumpTrigger; + + /// + /// detect if player has entered the trigger + /// + /// colliding game object + private void OnTriggerEnter(Collider other) + { + if (!other.CompareTag("Player") || !linkedJumpTrigger.isPlayerInAir) return; + Debug.Log("AerialFaithLandingTrigger: player landed"); + linkedJumpTrigger.isPlayerInAir = false; + } +} \ No newline at end of file diff --git a/RunningLateGame/Assets/Scripts/AerialFaithLandingTrigger.cs.meta b/RunningLateGame/Assets/Scripts/AerialFaithLandingTrigger.cs.meta new file mode 100644 index 0000000..966c0db --- /dev/null +++ b/RunningLateGame/Assets/Scripts/AerialFaithLandingTrigger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a8b674965ae7094458813aa68d06bb78 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: