How to Register AssetBundle to Dialogue System

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Saper
Posts: 43
Joined: Tue Jan 12, 2021 11:25 am

How to Register AssetBundle to Dialogue System

Post by Saper »

Hi Tony

I have problem with using audio from assetbundle, I don't know how to reference assetbundle to register it in Dialogue system. Those are my scripts and assetbundles files.
Create_AssetBundle.png
Create_AssetBundle.png (228.36 KiB) Viewed 789 times
Register_AssetBundle.png
Register_AssetBundle.png (167.18 KiB) Viewed 789 times
Files_AssetBundle.png
Files_AssetBundle.png (11.11 KiB) Viewed 789 times
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to Register AssetBundle to Dialogue System

Post by Tony Li »

Hi,

That code looks fine. Is it not working? Are you getting an error or warning in the Console window?
Saper
Posts: 43
Joined: Tue Jan 12, 2021 11:25 am

Re: How to Register AssetBundle to Dialogue System

Post by Saper »

I can't put any of generated files in to reference field for assetBundles. And i don't know what i'm doing wrong
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to Register AssetBundle to Dialogue System

Post by Tony Li »

Sorry, I don't follow. Have you built your asset bundle? If so, then after using DialogueManager.RegisterAssetBundle() whenever the Dialogue System needs to load a file from your asset bundles it will use AssetBundle.Load(name, type). For example, if you use a sequencer command AudioWait(Player_7_42), the Dialogue System will attempt to load: AssetBundle.Load("Player_7_42", typeof(AudioClip)).

Another option that you might find simpler is to use Addressables.
Saper
Posts: 43
Joined: Tue Jan 12, 2021 11:25 am

Re: How to Register AssetBundle to Dialogue System

Post by Saper »

After building assetbundle I tried reference those files to script and probably i'm doing something wrong or I forgot about something regarding Assetbundle
In_editor.png
In_editor.png (29.62 KiB) Viewed 753 times
In_editor2.png
In_editor2.png (16.87 KiB) Viewed 753 times
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to Register AssetBundle to Dialogue System

Post by Tony Li »

I missed what you were doing in that second script. Normally you'll create your asset bundle as a file in an editor script that builds asset bundles. Then, at runtime, you'll use AssetBundle.LoadFromFile() or AssetBundle.LoadFromMemoryAsync() to load the asset bundle. This will return an AssetBundle object that you can pass to DialogueManager.RegisterAssetBundle().
Post Reply