【m】 修改淡入淡出
This commit is contained in:
@@ -20,7 +20,6 @@ namespace Stary.Evo.AudioCore
|
||||
Voice = new VoicePlayer(Resources);
|
||||
SFX = new SFXPlayer(Resources);
|
||||
Music = new MusicPlayer(Resources);
|
||||
|
||||
}
|
||||
|
||||
#region 语音
|
||||
@@ -39,6 +38,7 @@ namespace Stary.Evo.AudioCore
|
||||
Debug.LogError("AudioCoreManager: Voice is null, please initialize it first.");
|
||||
return;
|
||||
}
|
||||
|
||||
Voice?.Play(audioData);
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace Stary.Evo.AudioCore
|
||||
Debug.LogError("AudioCoreManager: Voice is null, please initialize it first.");
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
return Voice.PlayAsync(audioData);
|
||||
}
|
||||
|
||||
@@ -71,6 +72,20 @@ namespace Stary.Evo.AudioCore
|
||||
Debug.LogError("AudioCoreManager: Voice is null, please initialize it first.");
|
||||
return;
|
||||
}
|
||||
|
||||
Voice.Stop();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 停止当前的语音
|
||||
/// </summary>
|
||||
public static async UniTask FadeOutVoice(float fadeDuration)
|
||||
{
|
||||
if (Voice == null)
|
||||
{
|
||||
Debug.LogError("AudioCoreManager: Voice is null, please initialize it first.");
|
||||
}
|
||||
await Voice.FadeOutMusic(Voice.GetAudioSource(), fadeDuration);
|
||||
Voice.Stop();
|
||||
}
|
||||
|
||||
@@ -92,6 +107,7 @@ namespace Stary.Evo.AudioCore
|
||||
Debug.LogError("AudioCoreManager: SFX is null, please initialize it first.");
|
||||
return;
|
||||
}
|
||||
|
||||
SFX.Play(audioData);
|
||||
}
|
||||
|
||||
@@ -105,6 +121,7 @@ namespace Stary.Evo.AudioCore
|
||||
Debug.LogError("AudioCoreManager: SFX is null, please initialize it first.");
|
||||
return;
|
||||
}
|
||||
|
||||
AudioData audioData = new AudioData();
|
||||
SFX.Stop();
|
||||
}
|
||||
@@ -126,6 +143,7 @@ namespace Stary.Evo.AudioCore
|
||||
Debug.LogError("AudioCoreManager: Music is null, please initialize it first.");
|
||||
return;
|
||||
}
|
||||
|
||||
Music.Play(audioData);
|
||||
}
|
||||
|
||||
@@ -142,6 +160,7 @@ namespace Stary.Evo.AudioCore
|
||||
Debug.LogError("AudioCoreManager: Music is null, please initialize it first.");
|
||||
return;
|
||||
}
|
||||
|
||||
Music.SetMusicVolume(fadeDuration, targetVolume);
|
||||
}
|
||||
|
||||
@@ -157,6 +176,7 @@ namespace Stary.Evo.AudioCore
|
||||
Debug.LogError("AudioCoreManager: Music is null, please initialize it first.");
|
||||
return;
|
||||
}
|
||||
|
||||
Music.Stop();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user