29 lines
		
	
	
		
			675 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			675 B
		
	
	
	
		
			C#
		
	
	
	
	
	
using System.Collections;
 | 
						|
using System.Collections.Generic;
 | 
						|
using UnityEngine;
 | 
						|
using UnityEngine.XR.Interaction.Toolkit;
 | 
						|
#if FMOD_AVAILABLE
 | 
						|
using FMOD;
 | 
						|
using FMODUnity;
 | 
						|
#endif
 | 
						|
 | 
						|
public class OnSocketSnapSound : MonoBehaviour
 | 
						|
{
 | 
						|
    [SerializeField]
 | 
						|
    EventReference soundRef;
 | 
						|
 | 
						|
    // Start is called before the first frame update
 | 
						|
    void Start()
 | 
						|
    {
 | 
						|
        if (GetComponent<XRSocketInteractor>())
 | 
						|
        {
 | 
						|
            GetComponent<XRSocketInteractor>().selectEntered.AddListener(SelectEnterEventHandler);
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
    private void SelectEnterEventHandler(SelectEnterEventArgs args)
 | 
						|
    {
 | 
						|
        RuntimeManager.PlayOneShot(soundRef, transform.position);
 | 
						|
    }
 | 
						|
}
 |