[Side note: late post today, as it was my birthday on Monday and I wanted to celebrate instead of post!]
Part The Last
The final spell in the figurative tome of great and unspeakable evils is that of knowing the engine - exploitation. This spell is actually a conglomeration of smaller ones which allow the developer complete control over the Unity framework, and as a result, should only be attempted by Necromancers with a level of 20 or higher. My own level is not nearly sufficient to power these particular evils to their greatest potential, but nevertheless, it is worth trying.
The first is concerned with delaying a MonoBehaviour. Sometimes, the delaying of a class or frame is useful for setup, as it may be reliant on others being set up first. To halt time in this respect, chant the Words of Power, sacrifice a goat to the Elder Gods, wear a mask made of the bones of your forefathers, and finally wrap the code that requires delaying in the following: IEnumerator Start() { yield return new WaitForEndOfFrame(); }
The second is concerned with adding parameters to a destruction method, which could be useful for playing sounds as a GameObject is destroyed (a Wilhelm Scream upon death, for instance).
The third is bending the custom editors from last week to work for inbuilt Unity classes - adding reset buttons to a Transform component, for instance, might be useful for testing animations.
The fourth describes a way of making variable names, when changed, still serializable. Referring to that variable with its previous name may be important for values that need saving within the system, at which point the developer must paint their name with blood on the skin of an ox and use the following line of code:
[FormerlySerializedAs(“originalName”)]
Placing code in the correct folder is an extremely important practice - it can be a nightmare searching for prefabs in the code if there isn't a predefined folder to put them in. Organising a filesystem is imperative if a developer wants to share their knowledge with everyone, and, judging from a lot of online examples, is not adhered to as well as it could (guilty as charged!). This fifth subspell should be one of the most obvious and immediate to use when starting a new project.
The sixth subspell is simple: keep Transform scales to a 1:1:1 ratio, if you can.
[Side note: there are many others, but far too many to mention here.]
How Could This Apply To Drunk Space!?
The most important thing to gain from this final lesson in the C# Necronomicon is that if all else fails, keep a library of relevant, useful, or interesting code on you at all times. The internet may not be available everywhere, so it is always important to make sure that there are backups around of whatever one might need. The Necronomicon suggests backing up all data on previous projects to a memory chip embedded in the skin on the back on one's hand, but if you don't have one handy, a flash drive shall do instead.