浏览代码

[Bot] Automated dotnet-format update

/main
Ciro Continisio 4 年前
当前提交
e1aa5f02
共有 5 个文件被更改,包括 18 次插入16 次删除
  1. 2
      UOP1_Project/Assets/ScriptableObjects/Events/RegularSFX.asset
  2. 6
      UOP1_Project/Assets/Scripts/Audio/AudioData/AudioCueSO.cs
  3. 21
      UOP1_Project/Assets/Scripts/Audio/AudioManager.cs
  4. 2
      UOP1_Project/Assets/Scripts/Audio/SoundEmitters/SoundEmitter.cs
  5. 3
      UOP1_Project/Assets/Scripts/Audio/SoundEmitters/SoundEmitterFactorySO.cs

2
UOP1_Project/Assets/ScriptableObjects/Events/RegularSFX.asset


m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d7847b6caa8e5464c80cd90a8cc33a19, type: 3}
m_Name: RegularSFX_Cue
m_Name: RegularSFX
m_EditorClassIdentifier:

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;

正在加载...
取消
保存