Microsoft.Unity.Analyzers icon indicating copy to clipboard operation
Microsoft.Unity.Analyzers copied to clipboard

[WIP] add lint: Allocating properties of Mesh should not be get in loop

Open KisaragiEffective opened this issue 1 year ago • 0 comments

Fixes #52

Checklist

  • [x] I have read the Contribution Guide ;
  • [ ] There is an approved issue describing the change when contributing a new analyzer or suppressor ;
  • [x] I have added tests that prove my fix is effective or that my feature works ;
  • [ ] I have added necessary documentation (if appropriate) ;

Short description of what this resolves:

I'll make this PR will:

  1. Address #52 (use mesh.vertexCount instead of mesh.vertices.Count)
  2. about Binding "Allocating-properties":
    1. Warn about
    2. Move it to outer scope that does not surrounded by loop construct

However this is incomplete, and will be convered in later commits.

Changes proposed in this pull request:

  • [x] lint on getting "allocating-properties" in loop
    • loop-dependency is not considered at the first commit
  • [ ] suggest mesh.vertexCount over mesh.vertices.Count

KisaragiEffective avatar Oct 17 '24 05:10 KisaragiEffective