60 lines
1.1 KiB
C#
60 lines
1.1 KiB
C#
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class TestAudioPlay : MonoBehaviour
|
|
{
|
|
public AudioSource audioSource;
|
|
|
|
|
|
public void TestFocus()
|
|
{
|
|
|
|
}
|
|
|
|
public class UXAuditoHelper : IUXAudioHelper
|
|
{
|
|
private AudioSource _audioSource;
|
|
|
|
public UXAuditoHelper(AudioSource audioSource)
|
|
{
|
|
_audioSource = audioSource;
|
|
}
|
|
|
|
public void PlayAudio(AudioClip clip)
|
|
{
|
|
_audioSource.PlayOneShot(clip);
|
|
}
|
|
|
|
public void PlayAudio(string clipName)
|
|
{
|
|
}
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
InputDeviceWatcher.OnDeviceChanged += OnInputDeviceChanged;
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
InputDeviceWatcher.OnDeviceChanged -= OnInputDeviceChanged;
|
|
}
|
|
|
|
private void OnInputDeviceChanged(InputDeviceWatcher.InputDeviceCategory obj)
|
|
{
|
|
Debug.Log($"InputDevice:{obj}");
|
|
}
|
|
|
|
|
|
private void Awake()
|
|
{
|
|
UXComponentExtensionsHelper.SetAudioHelper(new UXAuditoHelper(audioSource));
|
|
}
|
|
|
|
private void OnApplicationQuit()
|
|
{
|
|
}
|
|
|
|
}
|