Code: Select all
private static AudioClip LoadAudioClip(string audioFileName)
{
#if UNITY_EDITOR || USE_ADDRESSABLES
AudioClip audioClip;
#if UNITY_EDITOR
audioClip = Resources.Load<AudioClip>(audioFileName);
if (audioClip != null) return audioClip;
#if USE_ADDRESSABLES
var settings = AddressableAssetSettingsDefaultObject.Settings;
var allEntries = new List<AddressableAssetEntry>(settings.groups.SelectMany(g => g.entries));
var foundEntry = allEntries.FirstOrDefault(e => e.address == audioFileName);
if (foundEntry != null) audioClip = AssetDatabase.LoadAssetAtPath<AudioClip>(foundEntry.AssetPath);
if (audioClip != null) return audioClip;
#endif
#endif
return null;
}
Assets\Plugins\Pixel Crushers\Dialogue System\Scripts\Options\Timeline\Playables\Utility\PreviewUI.cs(269,23): error CS0168: The variable 'audioClip' is declared but never used
The code should probably be something like
Code: Select all
private static AudioClip LoadAudioClip(string audioFileName)
{
#if UNITY_EDITOR
AudioClip audioClip = Resources.Load<AudioClip>(audioFileName);
if (audioClip != null) return audioClip;
#if USE_ADDRESSABLES
var settings = AddressableAssetSettingsDefaultObject.Settings;
var allEntries = new List<AddressableAssetEntry>(settings.groups.SelectMany(g => g.entries));
var foundEntry = allEntries.FirstOrDefault(e => e.address == audioFileName);
if (foundEntry != null) audioClip = AssetDatabase.LoadAssetAtPath<AudioClip>(foundEntry.AssetPath);
if (audioClip != null) return audioClip;
#endif
#endif
#endif
return null;
}