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)
{
}
///
/// 自动去算 或者自己去算
///
///
public virtual void SetAutoCalu(bool calu)
{
}
}
[System.Serializable]
public class VolumeUnityEvent : UnityEvent { }
}