浏览代码

[Bot] Automated dotnet-format update

/main
Erik Locutura 4 年前
当前提交
4386bee3
共有 4 个文件被更改,包括 17 次插入15 次删除
  1. 6
      UOP1_Project/Assets/Scripts/Audio/AudioData/AudioCueSO.cs
  2. 21
      UOP1_Project/Assets/Scripts/Audio/AudioManager.cs
  3. 2
      UOP1_Project/Assets/Scripts/Audio/SoundEmitters/SoundEmitter.cs
  4. 3
      UOP1_Project/Assets/Scripts/Audio/SoundEmitters/SoundEmitterFactorySO.cs

6
UOP1_Project/Assets/Scripts/Audio/AudioData/AudioCueSO.cs


public class AudioCueSO : ScriptableObject
{
public bool looping = false;
[SerializeField] private AudioClipsGroup[] _audioClipGroups = default;
[SerializeField] private AudioClipsGroup[] _audioClipGroups = default;
public AudioClip[] GetClips()
{

public AudioClip GetNextClip()
{
// Fast out if there is only one clip to play
if(audioClips.Length == 1)
if (audioClips.Length == 1)
if(_nextClipToPlay == -1)
if (_nextClipToPlay == -1)
{
// Index needs to be initialised: 0 if Sequential, random if otherwise
_nextClipToPlay = (sequenceMode == SequenceMode.Sequential) ? 0 : UnityEngine.Random.Range(0, audioClips.Length);

21
UOP1_Project/Assets/Scripts/Audio/AudioManager.cs


public class AudioManager : MonoBehaviour
{
[Tooltip ("Amount of sound emitters created on Start")]
[Tooltip("Amount of sound emitters created on Start")]
[SerializeField] private int _initialPoolSize = 1;
[SerializeField] private SoundEmitter _soundEmitterPrefab = default;
[Tooltip("The SoundManager listens to this event, fired by objects in any scene, to play SFXs")]

{
return group.audioMixer.SetFloat("Volume", NormalizedToMixerValue(volume));
}
if(group.audioMixer.GetFloat("Volume", out float rawVolume)){
volume = MixerValueNormalized(rawVolume);
return true;
}
volume = default;
return false;
if (group.audioMixer.GetFloat("Volume", out float rawVolume))
{
volume = MixerValueNormalized(rawVolume);
return true;
}
volume = default;
return false;
return (-(value - 80) / 80) - 1;
return (-(value - 80) / 80) - 1;
}
private static float NormalizedToMixerValue(float normalizedValue)
{

if (soundEmitter != null)
{
soundEmitter.PlaySound(clipsToPlay[i], settings, audioCue.looping, position);
if(audioCue.looping)
if (audioCue.looping)
soundEmitter.OnSoundFinishedPlaying += OnSoundEmitterFinishedPlaying;
}
}

2
UOP1_Project/Assets/Scripts/Audio/SoundEmitters/SoundEmitter.cs


using System;
using UnityEngine.Events;
[RequireComponent (typeof(AudioSource))]
[RequireComponent(typeof(AudioSource))]
public class SoundEmitter : MonoBehaviour, IPoolable
{
private AudioSource _audioSource;

3
UOP1_Project/Assets/Scripts/Audio/SoundEmitters/SoundEmitterFactorySO.cs


[SerializeField]
private SoundEmitter _prefab = default;
public override SoundEmitter Prefab {
public override SoundEmitter Prefab
{
get
{
return _prefab;

正在加载...
取消
保存