CarterGames / AudioManager

A free audio/sound management system for Unity with automatic library management & more!
https://carter.games/audiomanager
MIT License
23 stars 1 forks source link

Suggestion: Own error messages #8

Open allesman opened 3 weeks ago

allesman commented 3 weeks ago

Hi! Right now, when I accidentally put a non existent string in the Play() function, I get this error message: NullReferenceException: Object reference not set to an instance of an object CarterGames.Assets.AudioManager.AudioPlayer.SetClip (CarterGames.Assets.AudioManager.AudioData clip, CarterGames.Assets.AudioManager.AudioClipSettings clipSettings) (at Assets/Carter Games/Audio Manager/Code/Runtime/Audio/Player/AudioPlayer.cs:192) While this is perfectly fine, it would be cool to see where exactly in my code I used an invalid sound name.

JonathanMCarter commented 3 weeks ago

Thanks for reporting this. I'll have a look at this when I get a mo. Likely to be later this week.

JonathanMCarter commented 3 weeks ago

Just to update, I've had a look at this. Overall a little overhaul to how audio is spawned is needed to improve the messaging to users for sure. I've noted that down for the 3.1.x update when I get around to it.

For now I'm able to see the call location of the error fine in the editor, It might be worth looking at the full log if the above is all you get in your logs.

A screenshot of me trying it in editor and seeing the full trace. I called to play in the test script, the last element of the stack.

image