|
Post by leroiduecchii on Nov 14, 2020 23:46:04 GMT
Hello.. I've bought this asset because it had some good things, but I ran in a big problem : In my game, I use sound in my ScriptableObject, used with SerializeField to insert an AudioClip, and playing it, but my list is huge, can I play an sound with an AudioClip ? Because I don't want to have so many sounds in my MasterAudio prefab..
Here an example of my script1 :
public class ObjectBase : ScriptableObject
[SerializeField] AudioClip myAudioClip; //+ a property named "MyAudioClip" to access it.
and 2nd script : I can Serialize a string with the AudioClip name to done that, but I've too many sound, I don't want to have a prefab with +100 sound, I'm new to this asset so, I think there is an easy solution.. If someone can help me please, thanks ^^
EDIT: Finally I've workarounded it with string SerializeField to find clip, now my prefab have more than 100 sounds yay I'm happy
public void PlayBlablaAnimation { AudioManager.instance.PlaySFX(ObjectBase.MyAudioClip, volume) }
|
|
|
Post by DarkTonic Dev on Nov 15, 2020 1:49:58 GMT
I don't know what AudioManager is but it's not part of Master Audio. That will go around our entire system and be unaffected by all our controls. So that's not what you want.
Please explain your aversion to having a lot of sounds in the Master Audio prefab, so that I may suggest a suitable alternative if necessary. We have a lot of functionality to help when working with large Hierarchies such as Bus filter, Text Group filter etc.
You can of course control what's in memory at all times through Resource Files, Addressables and other means.
Also, you can use a Dynamic Sound Group Creator game object to make temporary Sound Groups per Scene or even more granular.
-Brian
|
|
|
Post by leroiduecchii on Nov 15, 2020 3:57:30 GMT
Yeah, "AudioManager" was just an exemple from my old code, I don't know why I can't write below this code sooo.. And I fixed my problem, but I have another problem now : I don't know how to create a loop it's complicated, does this asset have something to creates loop ? I put my AudioClip in the MasterAudio Prefab, created a variation, but the variation doesn't play after the first music finished, I think I will do that by scripting tomorrow, that will be simpler I think, thanks for this answering me ^^
|
|
|
Post by DarkTonic Dev on Nov 15, 2020 5:26:21 GMT
Master Audio does not allow playing random Audio Clips outside the Master Audio game objects. You will need to configure it in Master Audio or Dynamic Sound Group Creator game objects to use it.
Sound Groups and Playlists both have a "loop" checkbox in the Variation or Song that's created. Just check it. It's off by default.
|
|
|
Post by leroiduecchii on Nov 15, 2020 11:46:56 GMT
I knew it, that isn't random sound, just my scriptable object is creatures, and they have a cry, but I've like more than 100 with different cry. And for looping, checking the box will be too easy lol, I want to create introless loop, so after my first loop is finished, I want to launch the song without intro and loop it.
|
|
|
Post by DarkTonic Dev on Nov 16, 2020 16:58:08 GMT
Use Sound Groups for your "cries". It's fine.
For that you'd use a Playlist with 2 songs, not a Sound Group. Loop the 2nd song. And turn on "Gapless Switching Switching" in Advanced Settings for best results.
|
|