#AudioMixer + Content Manager bug on build

1 messages · Page 1 of 1 (latest)

hexed moth
#

Do audio mixers works with content manager package? do content manager duplicate the audio mixer?

hexed moth
#

"Unity bundles both strongly-referenced and weakly-referenced objects into the same content archives, but handles them differently at runtime.
"

Do it bundles strong references outside subscene on same bundle? i`m using a strong reference on game UI

lean thorn
#

And it doesn't match ane from normal scene

#

So if you want to modify it's properties in runtime - get reference to subscene mixer

#

one per all subscenes

hexed moth
#

This is really bad ..

#

I need ugly code to fix it then

hexed moth
hexed moth
#

Is there any way to load from mono behaviour side without a messy code?

lean thorn
lean thorn
#

if you want to use mono behaviours as separate entry point into loop - you are going to have such troubles

#

just getting audio mixer from some managed singleton is good enough

#

and then audio system that is responsible for modifying mixer values - does it directly

#

oor

#

it calls mono behaviour methods

#

if you find it easier

hexed moth
# lean thorn except this

I found a way to share it.

        {
            if (RuntimeContentManager.GetObjectLoadingStatus(AudioMixerReference) == ObjectLoadingStatus.None)
            {
                RuntimeContentManager.LoadObjectAsync(AudioMixerReference);
            }

            if (RuntimeContentManager.GetObjectLoadingStatus(AudioMixerReference) == ObjectLoadingStatus.Completed)
            {
                AudioMixer = RuntimeContentManager.GetObjectValue<AudioMixer>(AudioMixerReference);

                UpdateAudioMixer();
            }
        }```
I have this on my SettingsWindow.cs (MonoBehaviour) and is working
#

I don`t like .. it is ugly but works

lean thorn
#

store it on managed icd in subscene

#

and load with subscene

hexed moth
lean thorn
hexed moth
lean thorn
#

good

#

😅

hexed moth
#

but the UntypedWeakReferenceId was stored on mono behaviour

lean thorn
#

oh right

#

those can only be stored in subscenes

#

otherwise content management doesn't know it needs to be included

#

so in any case - you must load via subscene

#

just so turn your Unity events on your manager into custom ones

hexed moth
#

It is included already because i have other references on subscene but anyway i will create a singleton only for it

lean thorn
#

and call them from system

hexed moth
lean thorn