Search Unity

AudioMixers getting a list at startup.

Discussion in 'Editor & General Support' started by fwalker, Feb 13, 2021.

  1. fwalker

    fwalker

    Joined:
    Feb 5, 2013
    Posts:
    255
    Is there a way to get a list of instantiated AudioMixers once the game has started?
    I am trying to avoid having to explicitly define a list of Mixers in a gameObject.
    And the Mixers are not in a Resource folder so I can't really get a list of all the mixers in the game either. Can I ? They are just defined in the Project outside resources.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,686
    Make a ScriptableObject that contains all your mixers dragged into it as a public array, then drag that ScriptableObject instance into anything that needs it.

    If you need to load dynamically without a prior reference, then at least the above ScriptableObject has to be in a Resources folder.