One Minute Wwise | Validating Wwise Types
How to check, whether your Wwise Type is empty. A quick look at .Validate() and .IsValid(). No commercials, no lengthy introductions - get "Wwiser" in only 1 minute.
Let's take a problem. Here's a pinecone, and on it, a script that is supposed to set the Switch to pinecone. But as you might have noticed, the Wwise Type Switch is empty. And despite setting the Switch when entering playmode, you don't get any notification in the console, about the Wwise Type not being assigned. Now maybe this is intentional, so you can choose to have some pinecones that have the sound, and others that don't. But what if you just forgot to assign it, or it was unassigned by accident? In such a case, you can use the Validate() function. You can use this function on any Wwise Type, like RTPCs or SoundBanks or Events. This function will validate whether you have assigned anything in your Wwise Type. And if you didn't, it will notify you in the console. Alternatively if you'd like to know the name of the game object, you can use the IsValid() function. This function, also looks whether you have assigned anything in your Wwise Type, but it doesn't print anything in the console. And as such, you can print the notification yourself and add the game object name to it. And that's it.
* The script with more details: https://github.com/MadsMaretty/OneMinuteWwise/blob/master/Validating%20Wwise%20Types/SetItemTypeOnStart.cs
* About Wwise Types: https://hubs.ly/H0rFxXj0
* About Unity scripts: https://docs.unity3d.com/Manual/CreatingAndUsingScripts.html
* About If Statements: https://learn.unity.com/tutorial/if-statements
* Creating a Wwise-Type property: https://hubs.ly/H0rFxXX0
* About "public" and other Access Modifiers: https://learn.unity.com/tutorial/scope-and-access-modifiers#5c8a40e9edbc2a001f47ccef
* How to connect Unity to your Wwise project: https://www.youtube.com/watch?v=Oin2x0px1kM
* Example on IsValid(): https://hubs.ly/H0rFxYz0