I’m following a tutorial about making a hierarchical state machine, and it’s also my first real attempt at heavily using getters and setters. If you look at my script linked below, you’ll notice that the getters and setters take up as much space as the declarations themselves, if not more. I use Rider as my IDE and it occasionally will suggest ‘auto-properties’ instead, but when I use them I don’t always understand the result and my googling has just made me more confused. I’m just wondering if there is a less verbose, more human readable way to implement getters and setters without all the duplication.
Gets/Sets
, and Interfaces
drove me crazy too. I now use Static Variables
, and only read or change due to whatever it is I plan to accomplish. It is a very broad topic, and some will argue that using Static is the worst. I disagree, except when it comes to debugging, that truly can be a nightmare.
But I would read into my post and answer on: