mirror of
https://github.com/PashaBibko/The-Mobius-Line.git
synced 2026-04-04 18:09:04 +00:00
30 lines
800 B
C#
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);
|
|
}
|
|
}
|