cakeslice / Outline-Effect

Outline Image Effect for Unity
MIT License
1.48k stars 201 forks source link

Removes unnecessary GetComponent #38

Closed hobnob closed 4 years ago

hobnob commented 6 years ago

There are a few areas in the OutlineEffect where GetComponent is used on PreRender, but doesn't need to be (which may affect performance)

This will remove all but 1 call (made at the Start of the scene) in favour of caching the information required on the Outline object

ghost commented 6 years ago

DeepCode found the following issues:

Critical: 0 Warning: 0 Info: 0

Priority breakdown:

Security Defect API Anomaly Rename Lint Info
Critical 0 0 0 0 0 0 0
Warning 0 0 0 0 0 0 0
Info 0 0 0 0 0 0 0

Most affected files:

File Critical Warning Info

See detailed analysis.

f0ff886f commented 5 years ago

It should be outline.MeshFilter, as well on L238 it shouldn't be outline.GetComponent<Renderer>() but outline.SkinnedMeshRenderer.