mattrdowney / planetaria

A Unity framework for Euclidean 2-sphere games (e.g. 2D virtual reality games) [quasi-MIT license]
Other
10 stars 2 forks source link

Remove most (all?) C# Properties #98

Closed mattrdowney closed 6 years ago

mattrdowney commented 6 years ago

I think they are the main reason for game slowdowns.

mattrdowney commented 6 years ago

This speedup only helps the editor(?): https://answers.unity.com/questions/1195923/doesnt-the-c-jit-inline-property-getters-in-unity.html

Still, this should definitely be implemented, because I use the editor frequently.

Moreover, singleton-like behaviors should be done in Awake/Start/constructor wherever possible (I think there's plenty of instances of me forgetting I can include the base and derived Awake calls to remove this problem).

mattrdowney commented 6 years ago

This doesn't make a lot of sense (it's a micro-optimization). Also, mirroring the Unity application programming interface (API) by using properties instead of variables makes sense (as it encapsulates but looks like a variable).