Skip to content

Commit

Permalink
Fixed broken interface.
Browse files Browse the repository at this point in the history
Note to self, turns out the refactor doesn't check inside #ifs
  • Loading branch information
McJones committed Feb 2, 2024
1 parent 5d89d94 commit db6c551
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Runtime/LineProviders/AudioLineProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ public void PrepareForLines(IEnumerable<string> lineIDs)
}

#if USE_ADDRESSABLES
private class AddressablesAudioLineProvider: IAudioLineProvider
private class AddressablesAudioLineProvider: IAssetLineProvider
{
AudioLineProvider audioLineProvider { get; set; }
public AudioLineProvider audioLineProvider { get; set; }

// Lines are available if there are no outstanding load operations
public bool LinesAvailable => pendingLoadOperations.Count == 0;
Expand All @@ -104,7 +104,7 @@ public LocalizedLine GetLocalizedLine(Line line)

// If the audio language is different to the text language,
// pull the text data from a different localization
if (audioLanguage != textLanguageCode)
if (audioLineProvider.audioLanguageCode != audioLineProvider.textLanguageCode)
{
textLocalization = audioLineProvider.YarnProject.GetLocalization(audioLineProvider.textLanguageCode);
}
Expand Down Expand Up @@ -146,7 +146,7 @@ public LocalizedLine GetLocalizedLine(Line line)
TextID = line.ID,
RawText = text,
Substitutions = line.Substitutions,
Metadata = YarnProject.lineMetadata.GetMetadata(line.ID),
Metadata = audioLineProvider.YarnProject.lineMetadata.GetMetadata(line.ID),
Asset = audioClip,
};
}
Expand Down Expand Up @@ -227,7 +227,7 @@ private void AssetLoadComplete(AsyncOperationHandle<AudioClip> operation)
completedLoadOperations.Add(stringID, operation);
break;
case AsyncOperationStatus.Failed:
Debug.LogError($"Failed to load asset for line {stringID} in localization \"{YarnProject.GetLocalization(audioLanguage).LocaleCode}\"");
Debug.LogError($"Failed to load asset for line {stringID} in localization \"{audioLineProvider.YarnProject.GetLocalization(audioLineProvider.audioLanguageCode).LocaleCode}\"");
break;
default:
// We shouldn't be here?
Expand Down

0 comments on commit db6c551

Please sign in to comment.