Repo created exclusively to realize tests regarding Roslyn Analyzers in the Unity Game Engine.
The Microsoft.Unity.Analyzers.dll
used in that repo is a compiled version that threats the rule below as error
:
Every script described below is a MonoBehaviour with an empty Start method, which should show errors in the Unity Console.
Since our intention in that example is to only run the Analyzers for the FeatureA
, Unity will should the error only for the MyFeatureA.cs
script as you can see in the image below:
Assets/RoslynAnalyzers/Microsoft.Unity.Analyzers.dll
has aAnalyzers.asmdef
close to it.
Assets/Scripts/FeatureA/MyFeatureA.cs
has aFeatureA.asmdef
close to it (which has a reference toAnalyzers.asmdef
).
Assets/Scripts/FeatureB/MyFeatureB.cs
has aFeatureB.asmdef
close to it (but without reference toAnalyzers.asmdef
)
Assets/Scripts/FeatureC/MyFeatureC.cs
has not asmdef (meaning it is part of theAssembly-CSharp.dll
)
Packages/00 - Simple Package/MySimplePackageScript.cs
has an asmdef for testing purposes.