Звук машин
This commit is contained in:
33
Assets/Crossy Road VR/Scripts/ActivateUILineScript.cs
Normal file
33
Assets/Crossy Road VR/Scripts/ActivateUILineScript.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
using UnityEngine.XR.Interaction.Toolkit.Filtering;
|
||||
|
||||
public class ActivateUILineScript : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
|
||||
private XRInteractorLineVisual line;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
line = GetComponent<XRInteractorLineVisual>();
|
||||
if (line == null )
|
||||
{
|
||||
Debug.Log("XRInteractorLineVisual is empty");
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPointerEnter()
|
||||
{
|
||||
line.enabled = true;
|
||||
|
||||
//Debug.Log("Point enter");
|
||||
}
|
||||
|
||||
public void OnPointerExit()
|
||||
{
|
||||
line.enabled = false;
|
||||
//Debug.Log("Point exit");
|
||||
// Например, убрать подсветку
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user