Добавлен гудок машинам
This commit is contained in:
@ -1,9 +1,15 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
using static UnityEngine.XR.OpenXR.Features.Interactions.DPadInteraction;
|
||||
|
||||
public class HitDetectorScript : MonoBehaviour
|
||||
{
|
||||
private bool _IsDead = false;
|
||||
public bool IsDead
|
||||
{
|
||||
get { return _IsDead; }
|
||||
}
|
||||
|
||||
[SerializeField] private GameObject _Menu;
|
||||
[SerializeField] private GameObject _ForwardSource;
|
||||
@ -17,6 +23,8 @@ public class HitDetectorScript : MonoBehaviour
|
||||
[SerializeField] XRBaseController _LeftController;
|
||||
[SerializeField] XRBaseController _RightController;
|
||||
|
||||
public UnityEvent Dead = new UnityEvent();
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
//Debug.Log(other.gameObject.name);
|
||||
@ -24,6 +32,8 @@ public class HitDetectorScript : MonoBehaviour
|
||||
{
|
||||
_IsDead = true;
|
||||
|
||||
Dead.Invoke();
|
||||
|
||||
move.enabled = false;
|
||||
_CharacterController.enabled = false;
|
||||
|
||||
|
Reference in New Issue
Block a user