PokemonNXT/Unity — pull request #6 by TechSuppport (2014-04-18 05:52:40+00:00)
Title: Ummm... ADAPTIVE SCORE@!

I added a simple adaptive score that changes when the player brings out their pokemon. I should be able to change it back when the player returns their pokemon, too. However, there is something very wrong with the code right now, as I can't return my pokemon or get out of the trainer dialogue when I walk near him. Am I doing something wrong since the Git was changed since I noticed there are two sections now? Also I'm learning a bit about the scripting process for Wwise in Unity and it would likely be easiest if all the sound design was done through it. With the integration package you can call from the soundbanks within any script. So it would be easy enough to call any sound event without having to do much of anything. For example, if I created a soundbank with all the character move sounds simply load the bank within the script and do an AkSoundEngine.PostEvent which takes 2 arguements. The code for playing a tackle sound might look like this...

void Start () {
uint bankID; //not used
AkSoundEngine.LoadBank( "SFX_Moves.bnk", AkSoundEngine.AK_DEFAULT_POOL_ID, out bankID);
AkSoundEngine.PostEvent (moveName, gameObject);
}

moveName could somehow be tied to the database of moves or something and I'm sure the code could be more versatile, but you get the idea. With those two lines of code you can play sound anywhere, anytime, in any script, so long as the sound initializer scripts are running. I believe I've put those on the music gameobject if you wanted to take a closer look at those. Let me know what you think! :)