feat: support asset bundle

This commit is contained in:
2026-05-15 16:45:58 +08:00
parent f34145d4cf
commit 0823328d99
27 changed files with 390 additions and 8 deletions
@@ -288,6 +288,17 @@ namespace OCES.Audio
DontDestroyOnLoad(gameObject);
this.ResourceLoader = gameObject.AddComponent<ResourceLoader>();
if (AudioExtendSettings.Instance.useAssetBundle)
{
string bundlePath = Path.Combine(Application.streamingAssetsPath,
AudioExtendSettings.Instance.audioBundlePath);
this.ResourceLoader.SetProvider(new AssetBundleAssetProvider(bundlePath));
}
else
{
this.ResourceLoader.SetProvider(new ResourcesAssetProvider());
}
string audioConfigPath = AudioExtendSettings.Instance.audioConfigPath;
@@ -388,8 +399,6 @@ namespace OCES.Audio
AudioObject childContainer = this.m_audioObjects.GetMappingResult(switchContainer.Id, currentStateValue);
return childContainer ?? this.m_audioObjects.GetDefaultSwitchOrFallback(switchContainer);
}
}
public static class AudioConfigLoader