Over the past week/weekend, much time has been spent implementing character class switching and code refactoring. A lot of code in UnityScript has been converted to C# for performance reasons, and also to help become accustom to C# programming in Unity. Though progress may not be readily visible at run-time, much has changed behind closed doors. These changes include:
- A complete restructuring of the Character script which includes separating class function (character classes, not classes in the programming sense) into its own class (in the programming sense). An individual character class is now contained within its own object, making it much easier to manipulate and switch character classes in code.
- A single Stat class that applies to both Item classes and CharacterClass classes alike. The Stat class includes many different functions that will come in quite handy and allow for more advanced manipulation of stats be done on the fly and require relatively little code. Things such as character stat calculation or implementing additional stats will be a breeze.
- Implementation of class-specific items.
- Proper updates to character graphics when an item is equipped or removed. This still needs to be handled on a network level, but works well locally.
- Exposure of many different aspects of initial character class data in the inspector. This will make toying with particular classes and their stats relatively easy.
Somewhat off topic, but I would recommend to any developer or anyone working with a developer, is reading the article about why software engineers are grumpy by Nicholas C. Zakas. You’d think he was a carpenter with the many different nails he hits on the head.