1

My company is working on a game in Unity and I'm starting to integrate static code analysis into our project. We use Xamarin Studio as our IDE and it has source analysis out of the box with a lot of rules we can use.

The question I have is how can I get Unity to recognize the Xamarin rules as compiler errors, warnings, etc? It seems to not even take them into consideration. It will certainly be useful to have coding standards that are easily enforced. Thanks in advance!

tdeeb
  • 11
  • 3

1 Answers1

0

You can't. Unity3D has an internal compiler independent of Mono let alone Xamarin and does not recognise Code Analysis. There are no user-settings that I can find in the Unity UI for the compiler sadly.

  • Do you know how teams typically use code analysis for Unity then? – tdeeb Oct 19 '15 at 18:14
  • @tdeeb I've not heard of anyone doing CA so much but [this game company](https://www.youtube.com/watch?v=q9aeNtKKXeo&list=PL74BsvJXcuTSB_tZABdURVsA-yDOJ4Oo9&index=17) describes how they wrote most of their code independent of Unity (by using a MVVM pattern) in Visual Studio (you can use Xamarin). By de-coupling the majority of your code from Unity allows you to develop outside of Unity and gain benefits such as code analysis. Give that a go perhaps –  Oct 20 '15 at 00:31