2026-03-09 20:38:15 +08:00
|
|
|
|
2025-12-05 19:04:53 +08:00
|
|
|
using UnityEngine;
|
2025-12-09 20:31:44 +08:00
|
|
|
using UnityEngine.UI;
|
2025-12-05 19:04:53 +08:00
|
|
|
|
|
|
|
|
public class TestAudioPlay : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public AudioSource audioSource;
|
2025-12-17 20:03:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
public void TestFocus()
|
|
|
|
|
{
|
2025-12-19 20:53:25 +08:00
|
|
|
|
2025-12-17 20:03:29 +08:00
|
|
|
}
|
|
|
|
|
|
2025-12-05 19:04:53 +08:00
|
|
|
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()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|