Files
MIRROR-The-Mobius-Line/Assets/Scripts/Player/PlayerCollisions.cs
2025-04-28 10:16:14 +01:00

30 lines
800 B
C#

using UnityEngine;
public partial class PlayerMovement : MonoBehaviour
{
private void OnTriggerStay(Collider other)
{
if (m_IsDead)
{
return;
}
if (other.CompareTag("Finish"))
{
m_IsDead = true;
m_GameCanvas.enabled = false;
m_CompletedCanvas.enabled = true;
float timeTaken = Time.time - m_StartTime;
m_CompletedText.text = "Congratulations you beat 'The Mobius Line'\nYou took " + timeTaken.ToString("0.00") + " seconds\nPress R to restart and try to get a faster time";
}
// Stops it trying to find the normals of portals
if (other.CompareTag("Portal")) { return; }
// Else adds it to the list
m_WallCollisions.Add(other);
}
}