UnityRosylnAnalyzer is a set of Roslyn analyzers and code fixes for Unity & Visual Studio.
Install the VSIX-File or build it from the source code.
- Cache invocation of various Unity methods like
GetComponent<T>()
, which are called in Update or FixedUpdate - Detect usage of Unity method with
string
parameters likeGetComponent("Camera")
orStartCoroutine("MyCoroutine")
and provides code fixes:GetComponent<Camera>()
andStartCoroutine(MyCoroutine())
- Detects if a coroutine method has a return type and
System.Collections.Generic.IEnumerator<T>
and replaces it with the typeSystem.Collections.IEnumerator