These are the result of:
typeof(MeshRenderer).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
in different conditions.
As we can see, specifically in builds made from Unity 2019, GetProperties returns only a couple of results, and more are added if they are called explicitly somewhere in the code of the project.
-
In Unity 2019.4.40, in the editor:
https://i.ibb.co/RvkxCRq/Screenshot-2022-08-18-at-11-17-43.png -
In Unity 2019.4.40 Android build, where MeshRenderer.material is never called explicitly in the project:
https://i.ibb.co/xFnvVwj/Screenshot-20220818-112201.png -
In Unity 2019.4.40 Android build, where MeshRenderer.material IS called explicitly in the project:
https://i.ibb.co/1zVRvTF/Screenshot-20220818-112401.png -
In Unity 2020.3.33 Android build, where MeshRenderer.material is never called explicitly in the project:
https://i.ibb.co/Lr0Lhg1/Screenshot-20220818-114356.png
Are these differences expected? Or is this a bug?
This is the test project I used to test it (just 1 script and 1 scene):