Перетаскивание скриптов
This commit is contained in:
31
Assets/Crossy Road VR/Scripts/HitDetectorScript.cs
Normal file
31
Assets/Crossy Road VR/Scripts/HitDetectorScript.cs
Normal 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");
|
||||
// }
|
||||
//}
|
||||
}
|
11
Assets/Crossy Road VR/Scripts/HitDetectorScript.cs.meta
Normal file
11
Assets/Crossy Road VR/Scripts/HitDetectorScript.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a4c85452440a82d49ba8699717838f48
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user