Перетаскивание скриптов

This commit is contained in:
2025-01-24 11:23:35 +03:00
parent 9cf33221ba
commit 10b8a5f496
6 changed files with 2 additions and 325 deletions

View File

@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class HitDetectorScript : MonoBehaviour
{
private void OnTriggerEnter(Collider other)
{
//Debug.Log(other.gameObject.name);
if (other.gameObject.CompareTag("Car"))
{
Debug.Log("Player was hitted car");
SceneManager.LoadSceneAsync(1);
}
}
//private void OnCollisionEnter(Collision collision)
//{
// Debug.Log(collision.gameObject.name);
//}
//private void OnControllerColliderHit(ControllerColliderHit hit)
//{
// Debug.Log(hit.gameObject.name);
// if (hit.gameObject.CompareTag("Car"))
// {
// Debug.Log("Car hitted");
// }
//}
}