61 lines
1.7 KiB
C#
61 lines
1.7 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using SRDebugger;
|
|
using System.ComponentModel;
|
|
|
|
public partial class SROptions
|
|
{
|
|
[Category("语音助手设置"), DisplayName("小于此音量一定时间后停止"), NumberRange(0, 0.008),Increment(0.001)]
|
|
public float MinVolume
|
|
{
|
|
get
|
|
{
|
|
return PlayerPrefs.GetFloat("minVolume", 0.002f);
|
|
}
|
|
set
|
|
{
|
|
PlayerPrefs.SetFloat("minVolume", value);
|
|
AudioRecorder recorder = GameObject.FindObjectOfType<AudioRecorder>();
|
|
if (recorder)
|
|
{
|
|
recorder.minVolume = value;
|
|
}
|
|
}
|
|
}
|
|
[Category("语音助手设置"), DisplayName("大于此音量为有效"), NumberRange(0, 0.01), Increment(0.001)]
|
|
public float maxVolume
|
|
{
|
|
get
|
|
{
|
|
return PlayerPrefs.GetFloat("maxVolume", 0.008f);
|
|
}
|
|
set
|
|
{
|
|
PlayerPrefs.SetFloat("maxVolume", value);
|
|
AudioRecorder recorder = GameObject.FindObjectOfType<AudioRecorder>();
|
|
if (recorder)
|
|
{
|
|
recorder.maxVolume = value;
|
|
}
|
|
}
|
|
}
|
|
[Category("语音助手设置"),DisplayName("最大语音录制时长"),NumberRange(5,20)]
|
|
public int maxRecordingLength
|
|
{
|
|
get
|
|
{
|
|
return PlayerPrefs.GetInt("maxRecordingLength", 20);
|
|
}
|
|
set
|
|
{
|
|
PlayerPrefs.SetInt("maxRecordingLength", value);
|
|
AudioRecorder recorder = GameObject.FindObjectOfType<AudioRecorder>();
|
|
if(recorder)
|
|
{
|
|
recorder.maxRecordingLength = value;
|
|
}
|
|
}
|
|
}
|
|
}
|