Files
PrinceOfGlory/Assets/代码/音量控制/VoiceVolumnChangedIntereface.cs
kridoo 6e91a0c7f0 111
2025-09-15 17:32:08 +08:00

37 lines
1022 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace AndroidWrapper
{
/// <summary>
/// 监听音量变化的监听接口
/// </summary>
public class VoiceVolumnChangedIntereface : AndroidJavaProxy
{
/// <summary>
/// 音量变化委托事件
/// </summary>
Action<int> _mVoiceVolumnChanged;
public VoiceVolumnChangedIntereface(Action<int> VoiceVolumnChanged) : base("com.example.voicevolumnwrapper.VoiceVolumnChangedIntereface")
{
_mVoiceVolumnChanged = VoiceVolumnChanged;
}
/// <summary>
/// 监听音量变化的接口
/// </summary>
/// <param name="currentValue"></param>
public void VoiceVolumnChanged(int currentValue)
{
if (_mVoiceVolumnChanged != null)
{
_mVoiceVolumnChanged(currentValue);
}
Debug.Log(GetType() + "/VoiceVolumnChanged()/ 监听音量变化的接口函数执行");
}
}
}