Using Properties in C#

October 3, 2019

Coding: Properties

In C#

C# Properties (GET, SET)

Link #1 – Tutlane

By: tutlane


Properties (C# Programming Guide)

Link #2 – Microsoft

By: Microsoft


How to: Declare and Use Read Write Properties (C# Programming Guide)

Link #3 – Microsoft

By: Microsoft


NOTES

I have been using private fields more often in my coding, even if it is not particularly necessary in Unity, as it is considered a better practice to keep control of the scope of your variables. I have also been working with code that needs to communicate outside of its own scene in Unity, which requires unique work as well. Both of these have led me to use various getting and setting techniques, and I am trying to clean up my code and do it more properly by learning more about creating properties and using getters and setters better.

It is my hope that these three sources cover everything that I am looking for, as well as giving me a better understanding overall of the capabilities of using these properties.