12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- using UnityEngine;
- using UnityEngine.Events;
- namespace SC.XR.Unity.Module_DetectorSystem
- {
- public enum StreamType
- {
- STREAM_VOICE_CALL = 0,
- STREAM_SYSTEM = 1,
- STREAM_RING = 2,
- STREAM_MUSIC = 3,
- STREAM_ALARM = 4
- }
- public class AudioPlugin
- {
- private static AudioPlugin instance;
- public static AudioPlugin Instance
- {
- get
- {
- if (instance == null)
- {
- if (Application.isEditor)
- {
- instance = AudioPluginWin.Create();
- }
- else if (!Application.isEditor && Application.platform == RuntimePlatform.Android)
- {
- instance = AudioPluginAndroid.Create();
- }
- else
- {
- instance = AudioPluginOther.Create();
- }
- }
- return instance;
- }
- }
- public VolumeUnityEvent OnValueChanged = new VolumeUnityEvent();
- public virtual void SetType(StreamType type)
- {
- }
- public virtual int GetVolume()
- {
- return 0;
- }
- public virtual int GetVolume(int type)
- {
- return 0;
- }
- public virtual int GetMaxVolume()
- {
- return 15;
- }
- public virtual void SetVolume(int value)
- {
- }
- public virtual void SetVolume(int type, int value)
- {
- }
- /// <summary>
- /// 自动去算 或者自己去算
- /// </summary>
- /// <param name="calu"></param>
- public virtual void SetAutoCalu(bool calu)
- {
- }
- }
- [System.Serializable]
- public class VolumeUnityEvent : UnityEvent<int> { }
- }
|