Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Audio Toolkit v2.2 (+object pooling class) launched on Asset Store

Discussion in 'Assets and Asset Store' started by Michael-ClockStone, Jan 18, 2012.

  1. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    We are proud to announce that our proven Unity Audio Toolkit (already in use by numerous commercial projects) has now been launched on the Asset Store. The current version v2.2 offers all the features a professional application requires to manage and play music and sound files in an easy and performance optimized way:
    • ease of use: play audio files with a simple static function call, creation of required AudioSource objects is handled automatically
    • conveniently define audio assets in categories using the customized inspector view
    • set properties such as the volume for the entire category
    • change the volume of all playing audio objects within a category at any time
    • define alternative audio clips that get played with a specified probability or order
    • uses audio object pools for optimized performance
    • set audio playing parameters conveniently, such as:
      o random pitch volume
      o minimum time difference between play calls
      o delay
      o looping
      o fade out / in
    • special functions for music including cross-fading
    • delegate event call if audio was completely played
    • playlist management with shuffle, loop, etc.

    BONUS: If you buy the Audio Toolkit you get our generic and extremely simple to use object pooling class for free! It can be used on any type of game object such as visual effects, etc.

    Please visit our ClockStone Unity Assets Website for code examples and the full (MSDN style!) documentation of the classes.

    Also check the Video Tutorial.

    Buy the Audio Toolkit on the Unity Asset Store here!

    There is also a free version available on the Asset Store.
     
    Last edited: Feb 6, 2012
  2. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,545
    Is full source available in pro version?
     
  3. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    Yes - you get the complete C# source code in the full version. The free version only contains a mono DLL.
    If you are missing a specific feature - please let me know and we will probably be able to update the toolkit quickly.
     
    Last edited: Jan 20, 2012
  4. patch24

    patch24

    Joined:
    Mar 29, 2009
    Posts:
    120
    Hey there. I had some quick questions. So this creates a new game object w/audio source for every sound that gets played? (If so, I can see where the object pooling came in handy here.) How would you use this API to play, say, a random sequence of sounds such as footsteps? does it try to continually create new game objects or can you reuse the same one for each foot?
     
  5. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    Yes, a new AudioObject with an AudioSource component is created every time a sound is played. And the AudioObjects are pooled by default to enable the best performance possible. So you don't have to do anything special for your footsteps sounds. Just create an "audio item" and name it e.g. "footsteps". Next, assign as many footstep sound variations as you wish to this audio item (the audio clips + settings, we call them "subitems" ). Then the different footsteps sound can either be played randomly or as a sequence in a fixed order. In the script you just call AudioController.Play( "footstep" ) and the toolkit will handle everything for you.
     
    Last edited: Feb 2, 2012
  6. patch24

    patch24

    Joined:
    Mar 29, 2009
    Posts:
    120
    Interesting. So, for instance, to control the rate at which the sounds are played, you override the speed of playback on the "footstep" audio item?
     
  7. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    No. The audio toolkit can not know at what points of time each footstep sound has to be triggered. You have to call AudioController.Play( "footstep" ) yourself each time the foot touches the ground during your particuliar run animation.
    But, using the audio toolkit, the sound artist can easily set as many variations of the footstep sound as desired (without script code changes) and the toolkit will choose the audio clip according to the settings (either randomly or in fixed order).
    Please have a look at our demo scene that also comes with the free version and I am sure you will quickly understand the concept.
     
  8. patch24

    patch24

    Joined:
    Mar 29, 2009
    Posts:
    120
    Cool. I downloaded your free version to check it out. It's very well thought out. Great job.
    I was able to centralize all my sound files and it makes it really easy to manipulate them.
    I'll be picking this up soon.

    One other quick question, is there a way to crossfade between sound file collections in an audio item?
    Would all the files need to be in separate playlists that use 'crossfade'?
    thanks.
     
  9. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    Not sure what you mean by "crossfade between sound file collections in an audio item".
    Automatic cross-fading is only done when you call AudioController.PlayMusic() or you play a playlist ( with AudioController.PlayMusicPlaylist() ).
    However, you can always cross-fade manually by calling AudioObject.Stop( fadeOutTime ) and AudioObject.FadeIn( fadeInTime ).
    Hope that answers your question.
     
  10. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    General appeal to all Audio Toolkit users: If there is a specific feature you are missing about the toolkit - please let me know and we will see to implement it during our next software update iteration.
     
  11. patch24

    patch24

    Joined:
    Mar 29, 2009
    Posts:
    120
    As an example, if you had a collection of, say, one second long wind sounds and wanted them looping, ideally you would have a way to crossfade between the sound files so you don't have one wind sound end, then another start, etc. Another use would be for ocean waves breaking...or footsteps sloshing through water. If there isn't a quick way to do this in AudioToolkit, I can write a coroutine that fades out and brings in sounds in an audio item group.
     
  12. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    I think that is something rather specific. Plus you would probably also want control over which specific sound effect is played and at what time (e.g. every now and then a storm comes up and you should play a couple of stormy wind sounds in a row). I think you go best if you implement your custom solution for this. Using the toolkit's fade in/out functions this should be quite easy.
     
  13. patch24

    patch24

    Joined:
    Mar 29, 2009
    Posts:
    120
    Actually I'm using this quite a bit in the game so far. It can be a good space saver to have multiple small sound files that get randomly played and looped rather than one large one that keeps repeating itself ...or having multiple sounds randomly play back one after another without crossfading which starts to sound unnatural. By shuffling their order and crossfading, even at random times, it can simulate a much more natural, less detectable, repeating sound field. As I said, not just for wind, but for ocean, water splashes, wood creaking on a ship, any sounds that get repeated and loop. Using Audio toolkit's fading functions in my coroutine is now getting me the right effect.
    thanks,
    -p
     
  14. patch24

    patch24

    Joined:
    Mar 29, 2009
    Posts:
    120
    Hey, so if I have the free version of the toolkit already in my scene and working, can I just import the paid version on top of it?
     
  15. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    Sure - just import the paid version package and then delete the AudioToolkit_FreeVersion.dll. All your settings will remain.
    If you want to use pooling don't forget to add the PoolableObject script to your AudioObject and enable pooling in your AudioController.
     
  16. KnuckleCracker

    KnuckleCracker

    Joined:
    Dec 27, 2011
    Posts:
    63
    I have a case where I would like the pool count to be the limit on the number of sounds that play. For instance, imagine I have a tower defense or RTS game with lots of little units. All of the units fire projectiles and there are 100 explosions that all happen within a few frames of each other. But, I never want to play more than say 10 explosion sounds at once. More than that... and the additive volume is too high and it generally sounds bad.

    So, I set the pool size to 10. Looking at the source, it looks like this means that the 11th simultaneously played sound will call InstantiateWithoutPool(). This of course creates an new object.

    Is there a way to limit the simultaneous sounds that play? I suppose I could keep a count myself, but I would have to decrease that count whenever each sound finished playing. Can this be done (delegate?) reliably?

    I may be missing something obvious (just purchased a few hours ago and have only started looking into it in the last 20 minutes).
     
  17. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    You can't limit the number of AudioObjects with the pooling feature. Actually this is not what you will want in the end. If you limit the number of sound objects then you could have e.g. have a situation where 20 explosion sounds are triggered at once plus you want a voice saying e.g. "Attack!". Then you will want the attack voice to be played in any case.
    You can solve this problem by using the "Min Time Between Play" value of the audio item which is already set to 0.1 be default. This value will prevent the same audio item to be played within the time frame of 0.1 seconds.
     
  18. KnuckleCracker

    KnuckleCracker

    Joined:
    Dec 27, 2011
    Posts:
    63
    Let me rephrase the question/feature request to ignore pooling:

    I need to me able to limit any sound effect so that only N of a given sound effect are playing at the same time. I don't need a global limit, it needs to be per sound. For instance, I never want more than 5 explosions playing at once, more than 10 lasers firing, more than 3 air raid sirens, etc. For some sound effects, I don't want a limit (like the Attack! voice in your example). I still set priorities on sounds (in the case with sound cards with low channels). I just can't let 32 explosion sounds all be playing at once... it sounds awful after the first 5 or 6, and can't be distinguished by the player anyway.

    I use this exact technique in two published games and it works very well (the games are not written in Unity). In those cases, I can easily track when a sound finishes playing so I implement my own counts/limits per sound (I increment when playing, decrement when finished, and always check the current value before playing).

    It looks like the "Min Time Between play" approximates this feature, but not closely. If there are three explosions that all go off on the same frame, I get 1 sound played. If those three are spread across several frames, I might get 2 or 3. In a case where there is a steady stream of explosions that fall on a time interval not evenly divisible by whatever I set for the "Min Time Between Play", I will get 1 explosion punctuated occasionally by two overlapping. In the case of a "per sound limit" feature, I simply never would have more than 3 playing at once (if N = 3). It wouldn't matter when they started, there just wound't be more than 3 allowed to play at any one time. As soon as one finished a new one could be played.

    Now I'm happy enough to enforce these limits myself if this isn't a feature you are interested in implementing... assuming I can tell when a sound finishes playing. So my fallback question is simply "can I tell when a sound finished playing?" (hopefully via a callback, not with polling).

    --Edit--
    I'll answer my own fallback question. It looks like you have a "completelyPlayedDelegate" on AudioObject. This checks the isPlaying member on the UnityEngine.AudioSource in Update(). This very conveniently encapsulates the "sound finished playing" concept in your framework. So worst case, I can run off an use this to implement my own per sound limits.
     
    Last edited: Feb 15, 2012
  19. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    That's correct, the completelyPlayedDelegate is called as soon as the audio was fully played.
    I don't get you point about the explosion sounds though. If your explosion is e.g. 2 seconds long and you set the MinTimeBetweenPlay to 0.5 then you will have 4 simultaneously playing explosion sounds at maximum. For our games this worked well.
     
  20. KnuckleCracker

    KnuckleCracker

    Joined:
    Dec 27, 2011
    Posts:
    63
    Don't get me wrong... having the MinTimeBetweenPlay is a great feature on a fantastic audio toolkit. It's very useful in many cases, and I'll be using it. While I'm at it, for anyone reading this and thinking about buying this toolkit... by all means do so. It will save you lots of coding on your own and is very fairly priced.

    So, here's a scenario:
    Imagine I have two units in my strategy game. They are fighting the enemy and they fire their weapons at their own rates. Focus only on the explosions of their shells when they hit. With only two units, I expect to hear each shell explode. It doesn't really matter when they hit... they could be 0.05 seconds apart or 1 second apart.... I expect two sounds even if those sounds overlap most of the time. In this case, I might want a MinTimeBetweenPlay of 0. For sake of argument, lets say that 0.1 seconds is fine for MinTimeBetweenPlay, though. I can't go much higher than that, else the case with two units produces explosion visuals that don't have any accompanying explosion sound. I'm always forced to have a very small MinTimBetweenPlay because of the case with only 2 units firing.

    Now, imagine I have 100 units. If the sound effects are 2 seconds long, I get 20 sounds playing at the same time. If they are 3 seconds it's thirty. I can't adjust the MinTimeBetweenPlay parameter to be higher so that I can limit the sounds, because of the case of just '2' units.

    Now imagine there are ten different weapons such that this is the case ten times over. Even 20 sounds per effect is too many... yet I can't limit the number per effect by increasing the MinTimeBetweenPlay, else I ruin the scenario when there are only a few units on screen fighting.

    That's one scenario for having a per-effect max play limit. Now most of the time in most cases the sound effects are brief and 0.1 for MinTimeBetweenPlay is probably fine, and everything is probably ok most of the time. So I'm good with your toolkit at this point, as it provides what I need. Any special cases where I need to limit by count, I can handle on my own with your delegate.
     
  21. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    The idea behind the MinTimeBetweenPlay is this: If you have to skip playing a sound effect, then skip the one that is the least noticeable. If two sound effects are triggered within a short MinTimeBetweenPlay then users probably won't notice. If you limit the maximum number of sounds e.g. to 5, then you could have the situation where 5 sounds (each 2 seconds) are triggered at almost the same time, and then a sixth sound is triggered let's say 1.5 seconds later, then this sound is skipped. My point is that this is probably more noticeable than if you would do it with the MinTimeBetweenPlay only.
    Anyway, there is a pretty easy way to have you maximum number thing implemented. Just do

    if( AudioController.GetPlayingAudioObjects( "explosion" ).Length < maxCount ) { AudioController.Play( "explosion" ); }

    If this is really a feature people miss I will implement it during one of our next updates.

    Update: This feature was added in v3 of the toolkit
     
    Last edited: Apr 22, 2012
  22. memetic-arts

    memetic-arts

    Joined:
    Feb 27, 2011
    Posts:
    82
    Hello Clockstone! Great job on the toolkit, really addresses a strong need. I just sent you an email via your website, which you can ignore now, as this is probably a better venue for asking my question.

    So, my question is basically the 800 pound gorilla in the room:

    Does the toolkit provide a feature that enables synchronized playback of multiple audio objects playing simultaneously, which may or may not have been triggered at the same time? E.g., is it possible to use the toolkit as a multi-track event-driven sequencer?

    There has been much discussion over the past several years within the community, with a number of different approaches being recommended -- though no final working code has actually been posted, at least as far as I could find. I'd scoop up the toolkit in a flash if it supported this requirement.

    Thanks, and congrats on the release, great job.

    ==rr
     
  23. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    @rrodkin:
    I'm not sure what exactly you mean by the synchronized playback. Therefore I am afraid the toolkit can't do this.
    Don't forget though that the full version comes with the entire source code which is quite easy to understand I believe. So you could still use the toolkit as a code base where you could add your own special features. Moreover, if you are a really nice you could share your extensions with us, so the entire commnity would profit.
     
  24. memetic-arts

    memetic-arts

    Joined:
    Feb 27, 2011
    Posts:
    82
    Thanks for the quick reply, really appreciate that!

    By "synchronized playback", I mean the ability to start one clip that is, for example, a drum track, and then to launch another clip at an arbitrary point in time, of say, a bass line, which would play in time with the drums. There are techniques to do this, using audio.timeSamples in combination with various update functions, so thought it would be a natural feature (or maybe next step!) for your toolkit. And it would save me (and many others, I'm sure) a huge amount of coding effort. If you're making any kind of music-based game (and not just an mp3 player), this type of function is a must-have.

    What is the source written in? I'm a JavaScript guy, though willing to extend into other realms if necessary . . .

    Thanks again . . .
     
  25. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    The source code is C#. To me this "synchronized playback" sounds rather specific and I am not sure if it makes sense to implement such a thing directly into the AudioToolkit.
    It shouldn't be very hard to implement such a functionality on your own though. You could use coroutines to trigger your bass line, or you could add your own script component to the AudioObject which checks audio.timeSamples during Update().
     
  26. memetic-arts

    memetic-arts

    Joined:
    Feb 27, 2011
    Posts:
    82
    Thanks . . . yes, definitely a niche, but there is a demand. And yes, audio.timeSamples on Update seems to be the workable approach . . . thought that if you had it worked into your tool already, and it was rock-steady, it would save me a lot of trial-and-error.

    No worries, though, we'll figure it out . . . I appreciate your quick reply, and will most likely pick up the Toolkit anyway (I need an excuse to learn C#!).

    Best of luck and continued success!

    ==rr
     
  27. kamakura1192

    kamakura1192

    Joined:
    Apr 1, 2012
    Posts:
    4
    Audio Toolkit can be used in javascript? :)
     
  28. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    Yes, but the AudioToolkit must be in the "Standard Asset" or "Plugin" folder. See the following Unity Forum Post for more information.
     
  29. kamakura1192

    kamakura1192

    Joined:
    Apr 1, 2012
    Posts:
    4
  30. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    We have released a major update to the Audio Toolkit (v3.0) and I have created a seperate thread for this: Unity Forum - Audio Toolkit v3 Release

    Among other stuff we have implemented the requested feature to limit the number of simultaneously playing audio instances as an addition to the MinTimeBetweenPlay solution.
     
  31. myprabath01

    myprabath01

    Joined:
    Sep 15, 2011
    Posts:
    33
    What is Defferent between Free and Pro version what is restrictions in Free version. BTW seems good tool :)
     
  32. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    The free version is restricted to 12 audio items. Additionally, the pro version comes with the pooling soolution and an audio event log viewer.
     
  33. sl4ppy

    sl4ppy

    Joined:
    Mar 23, 2010
    Posts:
    12
    Does the toolkit provide any solutions for spatial audio?

    ie: sounds played at the location of an object so that if said object moves across the screen left to right, the sound also pans with it left to right?
     
  34. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    You can certainly use it for 3d. The AudioController.Play(...) function takes either a 3D position or a Transform to parent an audio to a game object. For example:
    Code (csharp):
    1.  
    2. AudioController.Play( "mySound", new Vector3(100,0,0) ); // play at specified position
    3. AudioController.Play( "mySound", gameObject.transform ); // parent to game object
    4.  
    See the AudioController reference for details.
     
  35. eedok

    eedok

    Joined:
    Sep 21, 2009
    Posts:
    194
    So I have a looping sound called Ball Loop, I can play it by going AudioController.Play( "Ball Loop"); but then how do I stop it or alter the volume of it?

    EDIT: I see now AudioController.Play returns an AudioItem which I can alter
     
  36. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
  37. supernat

    supernat

    Joined:
    May 3, 2011
    Posts:
    44
    I just purchased and integrated your audio toolkit in, cleaning up my messy code in many places. Much thanks for creating this. I have one question and one suggestion though.

    Suggestion: I kind of got stumped for a bit when my music play list wasn't playing. I followed the debugger which was saying my clip "034503-long-play-sound" was not found in the list, but I had added the clip previously. What I figured out was that I had added the clip to the play list, then renamed the clip to a better name, so my suggestion is to find the clip in the play list if it is renamed and rename it there as well, because the name is valid, as it is the name of the sound file just not the Audio Controller class's name.

    Question: I create a category called Music, which is parented to a category called MainMenuMusic and another called InGameMusic. I have a single slider to change music volume, so I call SetCategoryVolume("Music"). In fact, I can see the TotalVolume change in the Inspector, but the Audio Source Volume does not change, so I can't have an instant feedback on volume. In my case, when I call SetCategoryVolume, I need it to apply instantly. Is this possible somewhere?

    Thanks!
    Chris
     
  38. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,125
    I didn't know this product existed. I have reinvented the wheel so to speak with lot of your features :( Good to know this product is out there! I may check it out sometime.
     
  39. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    @supernat:
    You are right, the renaming should also rename the entries in the playlist. We will implement this feature in an upcoming version
    About the parent category volume - this is in fact bug. It will get fixed in the next version. Sorry for this - parent categories are a new feature introduced in v5.0, so it was not used so much yet.
     
  40. marceloSpiezzi

    marceloSpiezzi

    Joined:
    Nov 12, 2012
    Posts:
    6
    Hi,

    I'm testing the audio toolkit now and I'm liking it very much!

    but there's something I want to know, what should I use on a mobile game for optmization purposes.
    One unique AudioController object for all the scenes with all the audio in the game (sound effects, musics...) or one different AudioController for each scene with just the audios used in that scene ??

    Thanks,
    Marcelo

    EDIT: i've already got the answer at the documentation!!
     
    Last edited: Nov 12, 2012
  41. supernat

    supernat

    Joined:
    May 3, 2011
    Posts:
    44
    No problem, figured it was just a bug since it was new. Thanks for taking care of it. It will be some time before I release anyway. Again, thanks for the very nice product!
     
  42. eedok

    eedok

    Joined:
    Sep 21, 2009
    Posts:
    194
    Not sure if it's just me or if the tool broke recently, but for whatever reason it's not saving any changes I make now. I make changes in edit mode and all seems fine, but as soon as I hit play it reverts to the way it was and stays that way even after exiting play mode, any way to fix this?
     
  43. supernat

    supernat

    Joined:
    May 3, 2011
    Posts:
    44
    What version of unity are you running? I've seen some bugs with my GUI plugins very similar to this that were issues with unity.
     
  44. eedok

    eedok

    Joined:
    Sep 21, 2009
    Posts:
    194
    3.5.6f4
     
  45. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    96
    Hi Clockstone,

    I purchased Audio ToolKit and love it! Saved me much time! Thanks for this great product.
    I have a question about PoolableObject, is there any easy way I can preload the audio clip with the AudioController?

    Thanks!
     
  46. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    I am not sure what you want to achieve. There is no need to preload audio clips that are set in the AudioController, they are already loaded into memory by Unity.
     
  47. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    96
    I have a volume trigger which plays audio(s) with AudioController when player hits coin(s). I found there is a CPU spike for 1st time the audio clip plays, please see attached screen. I am not sure if there is anyway to "preload" the audio clip or AudioObject into pool to avoid the CPU spike?

    Thanks for your help and Merry X'Mas everybody! ;)
     

    Attached Files:

  48. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    Yes, you can preload any poolable objects using the ObjectPoolController.Preload method (see http://unity.clockstone.com/audiotoolkitreference/Index.html ). Currently the AudioController does not do that automatically. Maybe it's a good idea to do so in the next toolkit update. So you only have to set the preloadCount value of the AudioObject prefab to >0 and preload is done without further code changes.
     
  49. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    83
    We have investigated this issue - here is what we found out:

    We were able to reproduce this problem in the situation when you are working on an AudioController object in the Hierarchy view (thus you have an instance of a GameObject with the AudioController script in a scene) plus you have turned the inspector lock on. Then - if you press the play button, then stop the game again and make changes in the AudioController, these changes will be lost the next time you press the play button.
    I think this is a Unity bug and I believe I can explain the behaviour: Whenever you press the play button Unity makes a copy of all the game objects in the scene's Hierarchy. This way changes done to game objects at runtime are not saved to the scene. Now when you have the inspector lock enabled the inspector still remembers the reference to the copy of the game object in the scene hierarchy and changes are made to this object instead of the game object in the scene.
    So the bug is that Unity changes the selected object in the inspector to the instantiated game object copy even though the inspector is locked. I will send a bug report to Unity, but during the meantime please avoid this issue by not using the inspector lock on game objects in the scene. Instead, use a prefab for the AudioController object, and lock the inspector on the prefab in the project view, not the scene hierarchy. This should be your preferred way of working with the AudioController anyway.

    eedok did not describe the exact situation in which this issue occured. Should you encounter this problem in a different situation that the one I described please let me know.
     
  50. bfowle

    bfowle

    Joined:
    Oct 1, 2012
    Posts:
    23
    This is more of an object pooling question. In addition to using object pooling in my audio, I have it attached to block prefabs that are created/destroyed dynamically. However, there are an uncertain number of these created via a level editor tool (for puzzle levels) that is loaded through LoadLevel. When this level is loaded it gives the log warning that the objects were instantiated w/o the ObjectPoolController. Any additional blocks that are created during gameplay are pooled properly after they are destroyed, but is there any way to pool the ones loaded through the LoadLevel and get rid of the load warning? Or was the object pooler not designed to be used this way?
     
unityunity