2024-12-16 15:10:08 +01:00
|
|
|
using UnityEngine;
|
|
|
|
|
2024-12-16 16:53:55 +01:00
|
|
|
public class ObstacleSafe : MonoBehaviour
|
2024-12-16 15:10:08 +01:00
|
|
|
{
|
2024-12-16 16:19:59 +01:00
|
|
|
public PlayerScript playerScript;
|
|
|
|
public GameObject playerObject;
|
2024-12-16 15:10:08 +01:00
|
|
|
|
2024-12-16 16:19:59 +01:00
|
|
|
public void Start()
|
|
|
|
{
|
|
|
|
playerScript = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerScript>();
|
2024-12-16 15:10:08 +01:00
|
|
|
}
|
|
|
|
|
2024-12-16 16:19:59 +01:00
|
|
|
public void Update()
|
2024-12-16 15:10:08 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-12-16 16:53:55 +01:00
|
|
|
public void OnCollisionEnter()
|
2024-12-16 15:10:08 +01:00
|
|
|
{
|
2024-12-16 16:53:55 +01:00
|
|
|
playerScript.isColliding = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void OnCollisionExit()
|
|
|
|
{
|
|
|
|
playerScript.isColliding = false;
|
2024-12-16 15:10:08 +01:00
|
|
|
}
|
|
|
|
}
|