Computer science
Today when working on my Unity3D game for Fantoche, I noticed it again: a short little squeak at the start of a triggered sound clip.
This has happened before in my prototype, but I chalked it off to my inferior post production skills when doing the first sound clips. The new sound clips, however, were pristine, I was sure of it.
So the problem had to be somewhere else. Changing a suspect in my trigger script did not change a thing.
Yet turning off 3D Sound in the Audio Importer Inspector did the trick: no more weird squeaks.1
Of course, there are situations where you would need the 3D Sound property set. I have yet to test this out. Maybe the squeak only occurred because my Audio Listener was so close to the Audio Source.
-
Of course that meant turning it off for almost 60 clips by hand, since there is no such thing as bulk change in Unity ... *grml* ↩
When getting an external SWF using a loader in ActionScript 3, you usually not getting the the MovieClip contained within. Luckily, the loader you used to get the SWF has a property content that contains that movie clip – and with that, also the timeline.
Props to Jonas, who told me that. I just hope I am getting it right here, since I finally didn't use it in my project ...
Sometimes, the state of an object decides which method has to be executed. Instead of an unwieldy switch construction like this ...
switch (task) { case "sleep": sleep(); break; case "walk": walk(); break; }
... you can use the someObject[someExpression] notation. This works for any object, and you can use it to access both variables and methods. All those lines from above become this:
this[task]();
Much faster. Only problem I have yet to figure out: what happens, when there is no method by this name?