Placeholder-Software / Dissonance

Unity Voice Chat Asset
71 stars 5 forks source link

Couple of API warnings #198

Closed Alexees closed 4 years ago

Alexees commented 4 years ago

Letting Visual Studio compile the code there are a couple of warnings that could be addresssed:

D:\Helios\HeliosAndroid\Assets\Plugins\Dissonance\Core\Audio\Playback\VoicePlayback.cs(146,37): info UNT0006: The Unity message "Reset" has an incorrect signature.
D:\Helios\HeliosAndroid\Assets\Plugins\Dissonance\Core\Config\VoiceSettings.cs(188,26): info UNT0007: Unity objects should not use null coalescing.
D:\Helios\HeliosAndroid\Assets\Plugins\Dissonance\Core\Config\DebugSettings.cs(43,26): info UNT0007: Unity objects should not use null coalescing.
D:\Helios\HeliosAndroid\Assets\Plugins\Dissonance\Core\Config\VoiceSettings.cs(223,28): info UNT0007: Unity objects should not use null coalescing.
D:\Helios\HeliosAndroid\Assets\Plugins\Dissonance\Core\Config\DebugSettings.cs(79,20): info UNT0007: Unity objects should not use null coalescing.
D:\Helios\HeliosAndroid\Assets\Plugins\Dissonance\Core\Config\ChatRoomSettings.cs(26,26): info UNT0007: Unity objects should not use null coalescing.
D:\Helios\HeliosAndroid\Assets\Plugins\Dissonance\Core\Config\ChatRoomSettings.cs(58,20): info UNT0007: Unity objects should not use null coalescing.
martindevans commented 4 years ago

Thanks for reporting these Alexees. I don't see these for some reason - do you have a plugin which produces Unity specific warnings (I do have unitytools installed).

I think all of these were probably false alarms, but just to be safe I've fixed all of them except the Reset warning (which I'd rather suppress).

Alexees commented 4 years ago

Hi Martin,

seems that VS’s Tools for Unity are capable of analyzing the code. I accidentally told VS to compile which I usually do not do and THEN I received all those.

martindevans commented 4 years ago

Odd, I tried that as well but it still didn't show me these warnings. Since I can't see the warnings I'm not 100% sure how to suppress the remaining one, could you give me a pragma which suppresses the first warning:

Assets\Plugins\Dissonance\Core\Audio\Playback\VoicePlayback.cs(146,37): info UNT0006: The Unity message "Reset" has an incorrect signature.

Thanks.

martindevans commented 4 years ago

Dissonance 7.0.2 has just released on the asset store which includes fixes for all these issues except that last one. I'll close this for now, but I will still include that last suppression if you get back to me. Thanks.

Alexees commented 4 years ago

Hi Martin,

Seems pragmas are not bound to CS warnings so you can just do this:

pragma warning disable UNT0006

pragma warning restore UNT0006